Skip to content

Instantly share code, notes, and snippets.

@RahulBRB
Created September 13, 2022 19:14
Show Gist options
  • Save RahulBRB/cc6781336af0d3998d08a763c91976cf to your computer and use it in GitHub Desktop.
Save RahulBRB/cc6781336af0d3998d08a763c91976cf to your computer and use it in GitHub Desktop.
Memory addresses
#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