Why doesn't a+++++b work?

前端 未结 9 1126
悲&欢浪女
悲&欢浪女 2020-11-22 06:26
int main ()
{
   int a = 5,b = 2;
   printf(\"%d\",a+++++b);
   return 0;
}

This code gives the following error:

error: lval

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 07:08

    Follow this precesion order

    1.++ (pre increment)

    2.+ -(addition or subtraction)

    3."x"+ "y"add both the sequence

    int a = 5,b = 2; printf("%d",a++ + ++b); //a is 5 since it is post increment b is 3 pre increment return 0; //it is 5+3=8

提交回复
热议问题