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
Explain Operator Overloading It is one type of Polymorphism, an significant feature of object-oriented programming .Polymorphism means one thing having many forms, i.e. here an

Looping Statements The statements usually used for looping are for, do-while, while. The goto statement can be used for looping, but its use is generally avoided as it leads to

Write a C++ program according to the following specifications 1. Display a brief description of the program. 2. Ask the user to specify the type of loading (end load, intermediate

solution of problem based on poiter

padovan string for natural numbers program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class Padov

Define Register Variables - Low Level Programming? The Register variables are a special case of an automatic variable. The Automatic variables are allocated storage in the memo

write a c++ program for the sum of 10 numbers and print out the average


Implement (a part of) electronic election Scenario where following political parties are participating in election: PPP, PML and PTI.  Create a class PollingStation where it stor

example of padovan string program