“l-value required” error

前端 未结 11 2199
离开以前
离开以前 2020-12-10 00:06

When do we get \"l-value required\" error...while compiling C++ program???(i am using VC++ )

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 00:46

    take for example

    *int a=10,b=20;

    int c=++(ab+1); above code will give error because inside the bracket you have a expression ont which you want to do increment operation which is not possible. So before doing doing that you have to store that value to some variable.so above code will error of "lvalue" required.

提交回复
热议问题