Increment a vector adress and assign it to a pointer
Why can't i do p=numbers++ or p=++numbers? The compiler shows the message:
"lvalue required as increment operand" but isn't the pointer p a left
value?
int main(int argc, char *argv[]){
int numbers[] = {1,2,3,4,5,6}, *p;
p=numbers++;
printf("%d ",*p);
return 0;
}
No comments:
Post a Comment