# 如何在 Mac 上用 VScode 撰寫 C++ ## Visual Studio Code 與 Visual Studio 的差別 ### Visual Studio Code 簡稱 VScode 他是一個非常好用的**編輯器** (Editor) 優點:輕量化、著重在程式碼編輯、跨平台 他有很多的插件,所以也可以自己客製化成為IDE > 由於 Mac 只有 VScode 所以我都是用這個 ### Visual Studio 他是一個整合開發環境 (IDE) 其中包括編輯器、編譯器、除錯工具等等 優點:不需要額外設定環境即可立即使用 windows 專屬 ## step.1 安裝 VScode  [官網網址](https://code.visualstudio.com/download) ## step.2 安裝 Xcode 他是 C++ 的編譯器  去 App Store 搜尋並下載 在終端機檢查是否安裝成功 ``` xcode-select --install ``` ## step.3 開啟 VScode 在延伸模組中安裝 `C++` 與 `Code Run`   ## step.4 在終端機輸入 先切換到你要寫C++的資料夾(建議路徑都是英文) 範例 ``` cd /Users/sumo/Documents/program/C++ ``` 切完資料夾打這串 ``` git clone https://github.com/Sumo0711/Configure_VSCode_for_C_on_macOS.git ```  打開 VScode 就會發現組態檔案都下載完成了 > 有興趣那四個檔案在做什麼的話,都可以點進去看我都有註解 ## step.5 測試  右鍵 Run Code 看看有沒有產生一個執行檔 如果有的話代表你成功嘍!
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up