Small Bug

I am a new researcher in CERN COMPASS experiment. But I look a small bug in ROOT (CINT). What is the result for a and b, after these operators:

int b=5;
int a=b+++b++;
cout<<“a=”<<a<<" b="<<b<<endl;

ROOT (CINT) give: a=11 b=7 , but all other compilators like gcc, g++, VC++, … give a=10 b=7.

I am new in C/C++ language, but i think the problem is in CINT.

10x.

rumen

Hi,

According to the C++ standard this piece of code had an undefined behavior!
Both answer are thus acceptable (i.e. don’t use this type of code)

Cheers,
Philippe.