basic pointer codeinclude stdafxhinclude


// 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

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: basic pointer codeinclude stdafxhinclude
Reference No:- TGS0221180

Expected delivery within 24 Hours