I wrote a simple macro void a(int i, int j , int k){
printf(" i = %d , j = %d , k=%d\n",i,j,k);
}
void textpp() {
int i =0;
a(i++,i++,i++);
} and execute it via CINT and via ACliC within one and the same ROOT session:
root.exe [0] .x textpp.cxx
i = 0 , j = 1 , k=2
root.exe [1] .x textpp.cxx++
Info in <TUnixSystem>: creating shared
. . .
i = 2 , j = 1 , k=0
root.exe [2]Could someone explain me why the results are different and which one is correct
This programm contains undefined behavior. First, the order in which arguments evaluated is not specified. But it doesnโt matter - your programm violates 5/4 :