-
-
Save amankharwal/515caa6c23b9ac15576e09340c190a30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int var = 20; | |
int *ptr; | |
ptr = &var; | |
cout << var << endl; | |
//Outputs 20 (The value of var) | |
cout << ptr << endl; | |
//Outputs 0x234f119 (var's memory location) | |
cout << *ptr << endl; | |
//Outputs 20(The value of the variable stored in the pointer ptr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment