// Basic pointer code
#include "stdafx.h"
#include iostream
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int FirstNumber, SecondNumber;
int * ptrNumber;
ptrNumber = &FirstNumber;
*ptrNumber = 10;
ptrNumber = &SecondNumber;
*ptrNumber = 20;
cout << "FirstNumber is " << FirstNumber << endl;
cout << "SecondNumber is " << SecondNumber << endl;
return 0;
}
Output:
FirstNumber is 10
SecondNumber is 20