
C++ 開發環境
在 Visual Studio Code 安裝 Code Runner
Visual Studio Code 為微軟提供的免費輕量級整合開發環境,可以在以下網址下載所需作業系統的版本
Visual Studio Code 支援多種程式語言檔案格式,基本上只要儲存或載入相關的副檔名,例如 C++ 副檔名為 .cpp 、 Python 的副檔名為 .py ,就會主動跳出該語言相關的 extension ,並建議安裝,各種 extension 功能不一,主要是讓寫程式可以更有效率。
至於執行程式就要安裝編譯或直譯的 extension ,其中 Code Runner 是通用多種程式語言的 extension ,如果要安裝 Code Runner ,請點擊下圖視窗中紅色箭頭指著,用紅色框線圍起來的方形圖示

接著就會出現如下圖紅色箭頭所指,搜尋 extension 的欄位

在搜尋欄位中打 Code Runner ,就會出現各種相關的 extension ,其中第一個就是我們要安裝的 Code Runner

繼續點擊右下角,如下圖紅色箭頭所指綠色的 Install 按鈕

然後 Visual Studio Code 會自動安裝 Code Runner ,注意要有網路連線。如果出現下圖視窗中紅色箭頭所指藍色的 Reload 按鈕,就再點擊這個按鈕

這時候在視窗的右上角就會出現如下圖視窗中紅色箭頭所指三角形的執行鍵

按下執行鍵, Code Runner 會自動呼叫安裝好的 g++ 指令,或其他程式語言相關的編譯器或直譯器去執行程式,執行結果會出現在底下 OUTPUT 頁籤

