L
lovecreatesbea...
K&R2, both sec A7.3.4 Postfix Incrementation and secA.7.4.1 Prefix
Incrementation Operators say that "The result is not an lvalue". Is
this correct? I don't see an errata on these points. If below the p++
or ++p is not an lvalue, then *p++ or *++p is a syntax error.
When it talks about Unary Operators, why doesn't the secA7.4 collect
both the prefix and postfix incrementation operators together?
int main(void)
{
char a[10] = {0}, *p = a;
/* a[0] = 'a'; a[1] = 'b'; */
/* *p = 'a'; *(p+1) = 'b'; */
/* *p = 'a'; *p++ = 'b'; p--; */
*p = 'a'; *++p = 'b'; p--;
return 0;
}
Incrementation Operators say that "The result is not an lvalue". Is
this correct? I don't see an errata on these points. If below the p++
or ++p is not an lvalue, then *p++ or *++p is a syntax error.
When it talks about Unary Operators, why doesn't the secA7.4 collect
both the prefix and postfix incrementation operators together?
int main(void)
{
char a[10] = {0}, *p = a;
/* a[0] = 'a'; a[1] = 'b'; */
/* *p = 'a'; *(p+1) = 'b'; */
/* *p = 'a'; *p++ = 'b'; p--; */
*p = 'a'; *++p = 'b'; p--;
return 0;
}