Wednesday, April 13, 2011

C++ pointer (step 1)

#include
using namespace std;

int main ()
{
  int *x;
  int c=200;
  x=&c;
  cout << " x is the address of c: " << x << endl;
  cout << " *x points at c: " << *x << endl;
  x++;
  cout << " x is the address of c: " << x << endl;
  cout << " *x points at c: " << *x << endl;
  return 0;
}

0 comments:

Sponsored By