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
Two kinds of line detection are implemented in OpenCV, the Hough Transform and the probabilistic Hough transform. Assume that there are n feature points in an image and that it tak

The break statement The break statement, which was already covered in the switch.. case, can also be used in the loops. When a loop statement is encountered in the loops the co

#queComputers are frequently used in check-writing systems, such as payroll and accounts payable applications. Many stories circulate regarding weekly pay- checks being printed (by

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Define the Int Data Type of C Language? The int is used to define integer numbers. The Integers are whole numbers with a range of values supported by a particular machine and t

how objects are initialized dynamically?

Mathematical Statements and assignments    Within C we can directly load up the variable from within the program using the mathematical expression equates (=) e.g.   a= 'h'

volume of a sphere

a program code for superposition of sine waves

write a C program for padovan string for a natural number   program 1 : package test.padovanstring; public class PadovanString {     public int stringOccurrences(int n,