#include #include const int GLOB_CONST1 = 1; const int GLOB_CONST2 = 2; int GLOB_VAR1 = 3; int GLOB_VAR2 = 4; int main(int argc, char **argv) { int static_var1 = 5; int static_var2 = 6; int *static_ptr1 = &static_var1; int *static_ptr2 = &static_var2; int *alloc_ptr1 = (int *)malloc(sizeof(int)); int *alloc_ptr2 = (int *)malloc(sizeof(int)); printf(" adresse, valeur, valeur pointée\n"); printf("GLOB_CONST1 %lu, %d\n", (unsigned long)&GLOB_CONST1, GLOB_CONST1); printf("GLOB_CONST2 %lu, %d\n", (unsigned long)&GLOB_CONST2, GLOB_CONST2); printf("\n"); printf("GLOB_VAR1 %lu, %d\n", (unsigned long)&GLOB_VAR1, GLOB_VAR1); printf("GLOB_VAR2 %lu, %d\n", (unsigned long)&GLOB_VAR2, GLOB_VAR2); printf("\n"); printf("static_var1 %lu, %d\n", (unsigned long)&static_var1, static_var1); printf("static_var2 %lu, %d\n", (unsigned long)&static_var2, static_var2); printf("\n"); printf("static_ptr1 %lu, %lu, %d\n", (unsigned long)&static_ptr1, (unsigned long)static_ptr1, *static_ptr1); printf("static_ptr2 %lu, %lu, %d\n", (unsigned long)&static_ptr2, (unsigned long)static_ptr2, *static_ptr2); printf("\n"); printf("alloc_ptr1 %lu, %lu, %d\n", (unsigned long)&alloc_ptr1, (unsigned long)alloc_ptr1, *alloc_ptr1); printf("alloc_ptr2 %lu, %lu, %d\n", (unsigned long)&alloc_ptr2, (unsigned long)alloc_ptr2, *alloc_ptr2); printf("\n"); /* free(alloc_ptr1); */ /* free(alloc_ptr2); */ /* printf("alloc_ptr1 %lu, %lu, %d\n", (unsigned long)&alloc_ptr1, (unsigned long)alloc_ptr1, *alloc_ptr1); */ /* printf("alloc_ptr2 %lu, %lu, %d\n", (unsigned long)&alloc_ptr2, (unsigned long)alloc_ptr2, *alloc_ptr2); */ /* printf("\n"); */ /* int *error_ptr1 = (int*) 36788656; */ /* printf("error_ptr1 %u, %u, %d\n", &error_ptr1, error_ptr1, *error_ptr1); */ return EXIT_SUCCESS; }