Skip to content

Instantly share code, notes, and snippets.

@missingdays
Last active October 7, 2015 16:26
Show Gist options
  • Save missingdays/77cb107268c468a9dd45 to your computer and use it in GitHub Desktop.
Save missingdays/77cb107268c468a9dd45 to your computer and use it in GitHub Desktop.
Return static
#include <stdio.h>
int* a(){
static int b = 5;
return &b;
}
int main(){
int *b = a();
printf("%d", *(b));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment