int *p, *q;
p = newint[5];
*p = 2; for (int i=0; i<5; i++)
p[i] = p[i-1] + i;
q = p;
delete[ ] p;
for (int j=0; j<5; j++)
cout<<q[j]<<" ";
cout<<endl;
I'm doing this for a test review. I'm kinda guessing and saying that it's the p[i - 1] and the delete[]p;
since q = p; you can't cout q if it's deleted.