Created
September 13, 2022 19:14
-
-
Save RahulBRB/cc6781336af0d3998d08a763c91976cf to your computer and use it in GitHub Desktop.
Memory addresses
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
#include <iostream> | |
int main() { | |
// memory address = a location in memory where data is stored | |
// a memory address can accessed with & (address-of operator) | |
std::string name = "BOB"; | |
int age = 21; | |
bool student = true; | |
std::cout << &name << '\n'; | |
std::cout << &age << '\n'; | |
std::cout << &student << '\n'; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment