Skip to content

Instantly share code, notes, and snippets.

@nickbclifford
Created January 30, 2021 04:13
Show Gist options
  • Select an option

  • Save nickbclifford/adeec4e7495585e8a1241c86996f1cc5 to your computer and use it in GitHub Desktop.

Select an option

Save nickbclifford/adeec4e7495585e8a1241c86996f1cc5 to your computer and use it in GitHub Desktop.

Revisions

  1. nickbclifford created this gist Jan 30, 2021.
    12 changes: 12 additions & 0 deletions bad.c
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #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;
    }