Pointers with an array, C/C++ Programming

// 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
Posted Date: 4/1/2013 3:23:05 AM | Location : United States







Related Discussions:- Pointers with an array, Assignment Help, Ask Question on Pointers with an array, Get Answer, Expert's Help, Pointers with an array Discussions

Write discussion on Pointers with an array
Your posts are moderated
Related Questions
I have an assignment , can I send it

please help me get all the inbuilt functions in c++

what will be the c program for ideal gas equation.

How can I handle a destructor that fails? Need help please provide example also.

This assignment is to be undertaken individually - no group work is permitted. Background information This assignment is an exercise in simple object-oriented programming and, acco

write c++ programm calculate electricity bill with person name,use ,id

write a static method with one integer parameter, x that returns the value of the polynomial 3x(2)- 7x + 2

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t

I need plugin for amibroker using c++ Project Description: Need to prepare plugin for amibroker using c++. Should be system bound after installing. System should show based o

Explain about the Character Constants in c language? The character constant is a single alphabet and a single digit or a single special symbol enclosed within a pair of single