Skip to content

Instantly share code, notes, and snippets.

@nickbclifford
Created January 30, 2021 04:13
Show Gist options
  • Save nickbclifford/adeec4e7495585e8a1241c86996f1cc5 to your computer and use it in GitHub Desktop.
Save nickbclifford/adeec4e7495585e8a1241c86996f1cc5 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int* get_ptr() {
int x = 7;
return &x;
}
int main(void) {
int* my_ptr = get_ptr();
printf("%d\n", *my_ptr);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment