VSCODE 설치
$ brew cask install visual-studio-code
C/C++ Extensions
설치 및 Reload
Build 와 Run task 작성
- Build 의 결과물인
a.out
을 Run task가 실행하는 구조
CMD + Shift + P -> Tasks:Run Task -> 실행하고자하는 task 이름 선택
#include <iostream> | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) { | |
std::cout << "hello Visual Studio Code! :)" << '\n'; | |
return 0; | |
} |
{ | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Build hello world", | |
"type": "shell", | |
"command": "g++", | |
"args": [ | |
"-g", | |
"helloworld.cpp" | |
], | |
"group": { | |
"kind": "build", | |
"isDefault": true | |
} | |
}, | |
{ | |
"label": "Run hello world", | |
"type": "shell", | |
"command": "./a.out" | |
} | |
] | |
} |