1. Installation
Download the Vscode installation package for Mac system from Vscode official website, then unzip the ZIP installation package to the desktop when the download is complete.
2, plug-in installation
Implement C/CPP Code Auto-completion, function jump.
After opening the Vscode, press the key combination "?? X ", open the extension, enter" C + + ", install the" C + + "," C + + Clang Command Adapter ", after the installation is complete, restart Vscode let the plugin take effect.
3, "Hello World"
After restarting, press the combo key again "?? X ", after opening the extension, the interface such as:
(1) Click "Open Folder",---> "New File",
(2) Press the combination key "?? Q ", such as Operation
Add "Launch.json" files, such as:
Modify "Launch.json", such as:
(3) Compiling
Press the key combination "?? B ", such as Operation
Generate the "Tasks.json" file:
Modify the "Tasks.json" file, such as:
(4) Implementation
Press the combo key again "?? B ", compile the CPP file, after the completion of the compilation," F5 "debugging execution, such as:
For the purpose and meaning of the parameters in the ". JSON" file, see "How does Visual Studio code write run C, C + +?" ”
Use Vscode for C + + development under Mac