Example of pointers, C/C++ Programming

#include "stdafx.h"

#include iostream

using namespace std;

int _tmain(int argc, _TCHAR* argv[])

{

            int NumbHold[5];

            int * ptrNumb;

            ptrNumb= NumbHold; 

            *ptrNumb= 10;

            ptrNumb++; 

            *ptrNumb= 20;

            ptrNumb= &NumbHold[2]; 

            *ptrNumb= 30;

            ptrNumb= NumbHold + 3; 

            *ptrNumb= 40;

            ptrNumb= NumbHold; 

            *(ptrNumb+4) = 50;

            for (int n=0; n<5; n++)

                        cout << NumbHold[n] << ", ";

            cout << endl;

            return 0;

}

Output:

10, 20, 30, 40, 50, 
Posted Date: 4/1/2013 3:24:55 AM | Location : United States







Related Discussions:- Example of pointers, Assignment Help, Ask Question on Example of pointers, Get Answer, Expert's Help, Example of pointers Discussions

Write discussion on Example of pointers
Your posts are moderated
Related Questions
padovan string program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class PadovanString {     publ

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

#write code for rotation in c

Write a program that writes your name on the monitor ten times. Write this program three times, once with each looping method.

Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun

hwat is the area fsdjlakl;aeklfjtealrtl;gka

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

how to get plus asterisk pattern


You are required to write a stand-alone DSP application in the C programming language. The overall objective of this application is to convert a signal from the time domain to t