Well, i want to know which is the order that a compiler "read" the code. For example:
Suppose I have the following code snippet:
int N, M;
N = M = 0;
In this case, the compiler would separete a part of memory (int, 4 bytes) for N and M, and then, at the second line (where comes my doubt), of two things, one:
The compiler "read" N equals to M and equals both to zero.
OR
The compiler "reads" the zero, put it in memory of M, then get the value of M, that is zero, and put it on memory of N.
In other words, it is from right to left, or from left to right ?
I don't know if became clear my doubt, but in a test that i made:
int i=0; /*I declared the variable i, and assign zero value to it*/
printf("%d", i++); /*Prints 0*/
printf("%d", i); /*Prints 1*/
I understand the above code, at the second line, the compiler seems(from what i undestood)"read" from left to right, assigning to the type %d the i value, and after print, the variable i is incremented, because at the third line it is printed as 1.
The code snippet below, reverses the position of the ++:
int i=0; /*I declared i variable to zero*/
printf("%d", ++i); /*Prints 1*/
printf("%d", i); /*Prints 1*/
In this case, at the second line, (from what i understood) the compiler "reads" from left to right,and when the compiler reads what will be printed (that stay after the comma, what is the name of this space?), first "reads" the ++ and increments the variable below that is i in this case, and then assign to %d to be printed.
In order, which is the order that a compiler "reads" ? I had some teachers that told me the compiler "read" from right to left, from the semicolon(;), but the compiler actually has an order? And if something that i told above are wrong, please, correct me.(I don't speak english very well)
Thanks!