answersLogoWhite

0

What is pointing program?

User Avatar

Anonymous

13y ago
Updated: 8/20/2019

// Pointing

// Demonstrates using pointers

#include

<iostream>

#include

<string>

using

namespace std;

int

main()

{

int* pAPointer; //declare a pointer

int* pScore = 0; //declare and initialize a pointer

int score = 1000;

pScore = &score;

//assign pointer pScore address of variable score

cout <<

"Assigning &score to pScore\n";

cout <<

"&score is: " << &score << "\n"; //address of score variable

cout <<

"pScore is: " << pScore << "\n"; //address stored in pointer

cout <<

"score is: " << score << "\n";

cout <<

"*pScore is: " << *pScore << "\n\n"; //value pointed to by pointer

cout <<

"Adding 500 to score\n";

score += 500;

cout <<

"score is: " << score << "\n";

cout <<

"*pScore is: " << *pScore << "\n\n";

cout <<

"Adding 500 to *pScore\n";

*pScore += 500;

cout <<

"score is: " << score << "\n";

cout <<

"*pScore is: " << *pScore << "\n\n";

cout <<

"Assigning &newScore to pScore\n";

int newScore = 5000;

pScore = &newScore;

cout <<

"&newScore is: " << &newScore << "\n";

cout <<

"pScore is: " << pScore << "\n";

cout <<

"newScore is: " << newScore << "\n";

cout <<

"*pScore is: " << *pScore << "\n\n";

cout <<

"Assigning &str to pStr\n";

string str = "score";

string* pStr = &str; //pointer to string object

cout <<

"str is: " << str << "\n";

cout <<

"*pStr is: " << *pStr << "\n";

cout <<

"(*pStr).size() is: " << (*pStr).size() << "\n";

cout <<

"pStr->size() is: " << pStr->size() << "\n";

return 0;

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What is logic with examples?

* Address used in programs * This term can be applied no matter whether the program is running in real or protected mode. *simply means the numbers that specify where a program is pointing in the PC's main memory.


What is alps pointing-device driver?

Alps Pointing-device Driver is developed by Alps and is used by 9 users of Software Informer. The most popular version of this product among our users is 7.0. The name of the program executable file is EzPopup.exe. The product will soon be reviewed by our informers.


What is Alps pointing device-driver?

Alps Pointing-device Driver is developed by Alps and is used by 9 users of Software Informer. The most popular version of this product among our users is 7.0. The name of the program executable file is EzPopup.exe. The product will soon be reviewed by our informers.


What direction head pointing?

The head is pointing forward.


Which direction is that arrow pointing?

The arrow is pointing to the right.


Is the fan pointing in or out of the window?

The fan is pointing out of the window.


Is optical character reader same as the touch screen computers found in ATM?

No. An OCR is a scanner combined with a recognition program. A touch screen is a monitor combined with a pointing device.


Is mouse for clikcing or selecting or pointing?

its for clicking pointing and selceting


In a wave the arrow is pointing to the?

In a wave the arrow is pointing to the amplitude.


When was Pointing Up created?

Pointing Up was created in 1982.


When was Pointing the Finger created?

Pointing the Finger was created in 1981.


How do you uninstall knctr by itibiti?

At the bottom right-hand corner of the monitor a little arrow pointing up can be found. Click this arrow, and then right click the KNCTR and choose the shut down option. Then the user can go into the program files and their control panel to remove the program.