Array increment operator in C
I don't understand the results of following code: #include <stdio.h> #include <conio.h> int main() { int a[4]={1, 3, 5, 6}; //suppose a is stored at location 2010 printf("%d\n", a + 2); printf("%d", a++); return 0; } Why does the second printf function produce following error? error: lvalue required as increment operand Grijesh Chauhan Part-1: Array names are constant (not modifiable lvalue), your can add value to array name but can't modify it. Expression a + 2 doesn't modify a itself but when you do a++ that is equivalent to a = a + 1 try to modify array name --lvalue error. The expression a