Last active
October 12, 2019 13:40
-
-
Save BMuscle/305c506e47cafb1992a87dbf06783deb to your computer and use it in GitHub Desktop.
ポインタ説明3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <malloc.h> | |
| int global; | |
| static int stglobal; | |
| void func1() { | |
| int local = 0; | |
| printf("ローカル変数func1=%p\n", (void*)&local); | |
| } | |
| void func2() { | |
| } | |
| int main() | |
| { | |
| int *p; | |
| printf("関数func1=%p\n", (void*)func1); // 007B1384 | |
| printf("関数func2=%p\n", (void*)func2); // 007B137F | |
| printf("文字列リテラル= %p \n", (void*)"abc"); // 007B7CE0 | |
| printf("グローバル変数=%p\n", (void*)& global); // 007BA464 | |
| printf("静的グローバル変数=%p\n", (void*)& stglobal); // 007BA468 | |
| p = (int*)malloc(sizeof(int)); | |
| printf("malloc %p\n", (void*)p); //00E054E8 | |
| int local = 0; | |
| printf("ローカル変数main=%p\n", (void*)&local); //00AFFDD8 | |
| func1(); //00AFFCF8 | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment