the parameter to free() must be the same pointer that was returned by malloc(), calloc() or realloc(). Your program destroyed that pointer in the printf() statement.
Why don't you use array a just like any other array instead of using pointer arithemic
for (i=0; i<SIZE; i++)
a[i] = i * i;
for (i=0; i<SIZE; i++)
printf("%d\n", a[i]);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343