#include <stdio.h>
int main()
{
int arr[] = {1, 2, 3, 4, 5};
int *p = arr;
++*p;
p += 2;
printf("%d", *p);
return 0;
}
Why this code does not give any compile-time error, my doubt ++*pis evaluated as ++(*p)it *pwill be a constant value 1when we do ++(1), which is not l-value , why does the compiler not give an error?
source
share