使用VisualStudioCompiler C語言
使用VisualStudioCompiler C語言
這篇介紹如何使用VisualStudioCompiler C語言。Visual Studio 2019 在預設情境下沒有辦法直接建 C 專案,
只能建 C++ 專案。不過 Visual C++ 仍然保有編譯 C 原始碼的功能
Visual Studio 2019 安裝<使用C++的桌面開發>

建立新專案 -> 主控台應用程式 (C++ Windows 主控台)

設定新的專案

將HelloWorld.cpp刪除

來源檔案 -> 右鍵 -> 新增項目 -> main.c

在main.c寫一個印出HelloWorld程式

專案 -> 右鍵 -> 屬性 -> C/C++ -> 所有選項 -> 尋找選項或參數Key上<編譯> -> 編譯成 改成 編譯成C程式碼(/TC)

編譯成HelloWorld.exe -> 執行exe
