The compilation error appears with lvalue required as Increment operand
These errors may be:
Char a[10] = {” hello “};
a++; A char[] is the address of the first and first element of this array. You cannot directly manipulate a++ to move the address. If you want to move, you can char *p = a; And then I’m going to do p, p++ which is exactly right.
2. int a = 0;
++a++; I’m also going to get an error here, (++a)++; It’s the same thing, and we have a++; You’ll also get an error. A++ ++++b is the same thing.
3. int fun()
{
Return 1;
}
+ + fun (); Here will also report the same mistake, the reason I do not know, looked for on the Internet, found baidu know there is a reply feeling can, ha ha, I am also a rookie, you guys see whether it is reasonable, there is an answer to tell me.
These two operators are the addition and subtraction operators provided by The C language. They are both unary operators and require only one operand, but operands can only be variables, not constants or expressions. As for the way you say they should be used, you can only use them with one variable, as a prefix or suffix operator, but as long as they are variables. Remember that they increase or decrease the value of the variable by 1, not simply by adding or subtracting 1.
Let me know if you find anything else that is also reporting this issue.
These errors may be:
Char a[10] = {” hello “};
a++; A char[] is the address of the first and first element of this array. You cannot directly manipulate a++ to move the address. If you want to move, you can char *p = a; And then I’m going to do p, p++ which is exactly right.
2. int a = 0;
++a++; I’m also going to get an error here, (++a)++; It’s the same thing, and we have a++; You’ll also get an error. A++ ++++b is the same thing.
3. int fun()
{
Return 1;
}
+ + fun (); Here will also report the same mistake, the reason I do not know, looked for on the Internet, found baidu know there is a reply feeling can, ha ha, I am also a rookie, you guys see whether it is reasonable, there is an answer to tell me.
These two operators are the addition and subtraction operators provided by The C language. They are both unary operators and require only one operand, but operands can only be variables, not constants or expressions. As for the way you say they should be used, you can only use them with one variable, as a prefix or suffix operator, but as long as they are variables. Remember that they increase or decrease the value of the variable by 1, not simply by adding or subtracting 1.
Let me know if you find anything else that is also reporting this issue.