








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









/* p pointer to a variable that points to an int */
/* p now points to i1 */
/* q now points to i1 too */
/* p now points to i2 */
/* the value of i1 is copied to i2 */
/* legal */
/* illegal - changing the constant */
/* ok: just changing the value */
int *p, q;int a= 89;p = &a;q = p;free(p);if (q) { … }
/* error: *q points to freed space */
89
q
p
a
if (data[0] == 'Q') { .. }
/* OK: just using the data */
data[2] = 42
/* Error: can't modify data */
int x = 42;return (&x);}