“lvalue required” error when trying to increment array [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Is array name a pointer in C? Suppose I have a char array say arr and arr will represent the address of first element so arr++ should be perfectly legal then why compiler says 'lvalue required'. Also if I do: arr=arr+1 then why it is invalid conversion. I am just increasing pointer by one. Compiler tells that on LHS the operand type is char[4] but on RHS it is char *. main() { char arr[]={'a','b','c','d'}; for(