Ask Your Question

Revision history [back]

Expression must be modifiable lvalue - c++ Error

I got the error when I execute the following code.

int *p;
p = (int *)malloc(128*sizeof(int *));
for (int i = 0; i < 128; i++)
{
    (*p + i) = 0;
}

Expression must be modifiable lvalue