Try   HackMD

Mac VSCode 寫 C/C++ 教學

特別感謝

安裝 Xcode

  • 進入 Mac App Store 搜尋 Xcode 並下載
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 在終端機輸入 xcode-select --install
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

安裝 VSCode

  • 進入 VSCode 官網並下載
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 解壓縮後拖到應用程式
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 開啟 VSCode 選擇 Extenion
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 安裝 C/C++
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →
  • 安裝 C++ Intellisense
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

開始撰寫 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 即可執行程式