Workspace에 .vscode 내에 launch.json에 넣는다.
launch.json
/* launch.json */
{
"version": "2.0.0",
"configurations": [
{
"name": "C++ Debug",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"preLaunchTask": "compile for C++",
"internalConsoleOptions": "openOnSessionStart",
// "logging": {
// "moduleLoad": false,
// "programOutput": true,
// "trace": false
// },
"showDisplayString": false,
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true, // set true to enable keyboard input
"osx": {
"MIMode": "lldb"
}
}
]
}
input을 넣으면서 디버깅이 필요할 때, "externalConsole": true로 하면 새 터미널이 나오며 거기에 input을 넣을 수 있다.
'Programming > C' 카테고리의 다른 글
| 단어 수 세기 프로그램 (1) | 2014.11.12 |
|---|---|
| scanf %s로 공백까지 입력받는 방법 (0) | 2014.11.03 |
| Selection Sort (0) | 2014.10.23 |
| 동적할당 (Dynamic allocation) (0) | 2014.09.25 |
| 메모리 구조 (0) | 2014.09.25 |