Saturday, April 28, 2012

7.32

Why is the following C code illegal?

{
   int x[3];
   x = (int *) malloc(3*sizeof(int));
   ...
}

x is an array, which stores an address. this is the same thing as trying to assign something to an "address of" statement

No comments:

Post a Comment