fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int a = 1;
  6.  
  7. int *p = &a; // (1) ポインタ変数の宣言と初期化: 変数aのアドレスをpに格納
  8.  
  9. *p = 10; // (2) 間接参照による値の変更: pが指すアドレス(a)の値に10を代入
  10.  
  11. printf("%d\n", a);
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5268KB
stdin
Standard input is empty
stdout
10