Pointers with an array, C/C++ Programming

Assignment Help:

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

Related Discussions:- Pointers with an array

Programming, pseudocode for gregorian calendar

pseudocode for gregorian calendar

Why do c++ compilers require name mangling?, A: Name mangling is the rule a...

A: Name mangling is the rule according to which C++ modify function's name into function signature before passing that function to a linker. It is how the linker differentiates amo

Algorithm, Algorithm for railway ticket booking process

Algorithm for railway ticket booking process

Odd even program, Write a program called OddEven that will prompt the user ...

Write a program called OddEven that will prompt the user for an integer and print/display a message indicating whether it is even or odd. Continue prompting for numbers from the us

Help me for an programming contest .., Pebble Merchant Problem Description...

Pebble Merchant Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides

Compiler design, Compiler Design - Limit In The Method Instructions

Compiler Design - Limit In The Method Instructions

In p = new fred(), Q: In p = new Fred(), does the Fred memory "leak" if  Fr...

Q: In p = new Fred(), does the Fred memory "leak" if  Fred constructor throws an exception? A: No.         If an exception take place during the Fred constructor of p = new F

How can one make it so keys pressed through users are , How can one make it...

How can one make it so keys pressed through users are not echoed on the screen? A: It is not a standard C++ feature. C++ doesn't even need your system to have a keyboard or a sc

Stack operations - c++, Stack operations - C++: Write a program to def...

Stack operations - C++: Write a program to define basic stack operations in c++. int Stack::push(int elem) {    int m = getmax();    if (top    {       put_

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd