CS201 Pointer Problems Date: _________ Name:__________________________
main()
{  int a, b, c;
    int *p, *q;
    a = 4;
    p = &a;
    q = p;
     ++q;
     *q = *p +4;
      c = *p + *q;
     cout <<a<<*p<<*q;
}
Output

Symbol Table
Name Address Size















1000



1002



1004



1006



1008



1010



1012



1014




main()
{  int x, y=3;
    int *a, *b=&x;

      *b = 2;
       a = b;
        ++b;
        *a = *a + 1;
        cout<<*a;
}
Output


Symbol Table
Name Address Size















1000



1002



1004



1006



1008



1010



1012



1014





main()
{  int x[3];
    int d, *a;
    x[1] = 5;
    a=x;
    *a = x[1] + 3;
    d = x[0];
     cout <<*a<<d;
}
Output

Symbol Table
Name Address Size
















1000



1002



1004



1006



1008



1010



1012



1014





main()
{ int f[4] = { 2,3,5,6 };
   int *g, *h, m;
   g= f;
    h = &f[2];
    m = *g + *h;
    ++h;
     ++g;
     cout<<*g<<*h<<m;
}
Output
 
Symbol Table
Name Address Size
















1000



1002



1004



1006



1008



1010



1012



1014