■ソースコード
#include <stdio.h>
int main(void){
int a;
int *p;
int n[3];
printf("%d\n",a);
printf("%p\n",p);
printf("%d,%d,%d\n",n[0],n[1],n[2]);
}
■コンパイル(警告が出る)
>cl helloauto2.c
Microsoft(R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
helloauto2.c
g:\sit\2010a\helloauto2.c(7) : warning C4700: 初期化されていないローカル変数 'a' が使用されます
g:\sit\2010a\helloauto2.c(8) : warning C4700: 初期化されていないローカル変数 'p' が使用されます
g:\sit\2010a\helloauto2.c(9) : warning C4700: 初期化されていないローカル変数 'n' が使用されます
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:helloauto2.exe
helloauto2.obj
■実行結果
>helloauto2.exe
0
0012FF80
-2,4215543,4215563