Space as a sign of its influence on the estimation of a binary or unary operator

I wonder about tokens and how they are evaluated by the compiler. But I never considered space as an important token for parsing a statement,

For instance.

#include<stdio.h>
int main(){

        int first=1,second=3;
        int res=first+++++second;
        printf("%d \n",res);
        return 0;
} 

Gives the following error:

rough3.c: 7: 17: error: lvalue, required as an increment operand int res = first +++++ second;

But just adding "" between the two postfix (++) and the prefix (++) seems to work fine.

#include<stdio.h>
int main(){

        int first=1,second=3;
        int res=first++ + ++second;
        printf("%d \n",res);
        return 0;
} 

Performs small fonts with a value of 5. I examined this question , and then the undefined behavior I want to know:
When does the compiler decide that spaces between expressions are redundant or not?
What happens when we put priority and associativity together to evaluate these expressions?

+4
2

C (6.4 )

4 , - , . : #include preprocessing #pragma. , , .

,

int res=first+++++second;

first, first ++

int res=first++ +++second;
             ^^

++

int res=first++ ++ +second;
             ^^ ^^ 

..

,

int res=first++ ++ + second ;
             ^^ ^^ ^ ^^^^^^ ^

C

int res= (first++)++ + second;

, (first++) lvalue. , ++ .

+4
int res=first+++++second;

int res = (first++)++ +second; 

, , (first++) l-.

int res=first++ + ++second;

int res = (first++) + (++second); 

.

+2

Source: https://habr.com/ru/post/1671357/


All Articles