---
title: Mac VSCode 寫 C/C++ 教學
tags: VSCode, computer
---
# Mac VSCode 寫 C/C++ 教學
## 特別感謝
- [@angel-star](https://github.com/angel-star) 提供相關檔案
## 安裝 Xcode
- 進入 Mac App Store 搜尋 Xcode 並下載

- 在終端機輸入 `xcode-select --install`

## 安裝 VSCode
- 進入 VSCode 官網並[下載](https://code.visualstudio.com/)

- 解壓縮後拖到應用程式


- 開啟 VSCode 選擇 Extenion

- 安裝 C/C++

- 安裝 C++ Intellisense

## 開始撰寫 C/C++
- 進入 repository 選擇 Clone or Download --> Download ZIP
- 或在終端機輸入 `git clone https://github.com/liaojason2/vscode_template_for_Mac.git`

- 下載完後進行解壓縮

- 隨便開一個資料夾

- 進入解壓縮後的檔案,在鍵盤上打`Command+Shift+.`檢視隱藏檔案,複製 .vscode 至剛剛隨意新增的資料夾內


- 開啟 VSCode

- 開啟剛剛隨意新增的資料夾

- 選擇 New File 新增檔案

- 撰寫程式

- 按 `Command+Shift+B` 進行編譯

- 按 Ctrl+Shift+\` 開啟終端機
- 輸入 ./<檔名>.out 即可執行程式
