I'm trying an example of the book "Understanding and using Pointers" that has this code:
int main()
{
char *pc = (char*)malloc(6);
for (int i = 0; i < 5; i++)
{
*pc[i] = 0;
}
return 0;
}
In theory, it should work, but I get the error:
Operand of * must be a pointer.
Can you tell me what's wrong? I am using Visual Studio 2015 Community.