Skip to content

Instantly share code, notes, and snippets.

@saga
Created December 20, 2010 06:38
Show Gist options
  • Save saga/748098 to your computer and use it in GitHub Desktop.
Save saga/748098 to your computer and use it in GitHub Desktop.
local variable address
#include <stdio.h>
int main (int argc, char *argv[])
{
int a = 99;
int b = a;
int* pLocala = NULL;
int* pLocalb = NULL;
int d = 1;
printf("hello world \n");
do{
int a = 3;
int b = 23;
pLocala = &a;
pLocalb = &b;
b = a + 5;
printf("%d %p\n", b, &a);
}while(0);
int e = 1;
b = a;
printf("%d %p\n", b, &a);
printf("%p %p %p %p %p %p %p %p\n", &e, pLocalb, pLocala, &d, &pLocalb, &pLocala, &b, &a);
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment