テキストエディタを使って次のプログラムファイルを作成。「hello.c」のようなファイル名で保存.
#include <stdio.h>
int main() {
printf("Hello,World!\n");
printf("sizeof(size_t)=%ld\n", sizeof(size_t));
return 0;
}
起動は,Windows のメニューで「Visual Studio 20..」の下の「x64 Native Tools コマンドプロンプト (x64 Native Tools Command Prompt)」を選ぶ.「x64」は,64ビット版の意味である.
※ Windows のメニューに,「x64 Native Tools Command Prompt」が無いときは,Visual Studio 2019 のインストールプログラムを再実行し,「ビルドツール」と書かれたものを追加インストールするという手順で解決すること.
以下の操作は,x64 Native Tools コマンドプロンプトで行う
エラーメッセージが出ていないことを確認.
where cl
結果として,「Hello,World!」「sizeof(size_t)=8」と表示されればOK.
cl hello.c .\hello.exe