Skip to content

Instantly share code, notes, and snippets.

@feldspath
Created August 1, 2021 15:38
Show Gist options
  • Save feldspath/26aaedee1ef44e56fd8e23270add1ef3 to your computer and use it in GitHub Desktop.
Save feldspath/26aaedee1ef44e56fd8e23270add1ef3 to your computer and use it in GitHub Desktop.
#include <iostream>
int* initialize_a() {
int a = 3;
return &a;
}
int main() {
int *pa = initialize_a();
std::cout << "a value: " << *pa << '\n';
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment