Skip to content

Instantly share code, notes, and snippets.

@BMuscle
Last active October 12, 2019 12:08
Show Gist options
  • Select an option

  • Save BMuscle/1d676ad7ceb212e8061fd2490c4b7642 to your computer and use it in GitHub Desktop.

Select an option

Save BMuscle/1d676ad7ceb212e8061fd2490c4b7642 to your computer and use it in GitHub Desktop.
ポインタ説明1
#include <stdio.h>
int main()
{
int a; //int型変数aを宣言
int* p; //int型のポインタpを宣言
p = &a; //aのアドレスをpに格納
a = 10; //aへ10を格納
printf("p = %d\n", *p); //・・・①
*p = 20; //pに格納されているアドレスを参照して20を格納する
printf("a = %d\n", a); //・・・②
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment