I keep getting a segmentation fault (core dumped) message whenever I try to run this C program.
#include <stdio.h>
int main()
{
int i = 200, *p, *q, *r;
p,r = &i;
q = p;
*q = *p + 1;
printf("*p = %d\n", *p);
printf("*r = %d\n", *r);
return 0;
}
It didn't have any r
s at first but I had to add r
s as an alias to i
and then Add print statements to output the dereferenced values of q
and r
.