Add vscode test

This commit is contained in:
daleclack 2021-01-10 11:29:04 +08:00
parent 3e4f36a45a
commit 4456a6b678
7 changed files with 73 additions and 0 deletions

29
cpp/vscode-test/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,29 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "g++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: g++ build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}

27
cpp/vscode-test/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,27 @@
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"*.cpp",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}

BIN
cpp/vscode-test/main Normal file

Binary file not shown.

8
cpp/vscode-test/main.cpp Normal file
View File

@ -0,0 +1,8 @@
#include <cstdio>
#include "stdafx.h"
int main(int argc,char *argv[]){
printf("hello vscode\n");
print();
return 0;
}

BIN
cpp/vscode-test/stdafx Normal file

Binary file not shown.

View File

@ -0,0 +1,8 @@
#include <cstdio>
void print(){
fflush(stdin);
char str[57];
fgets(str,sizeof(str),stdin);
printf("%s\n",str);
}

1
cpp/vscode-test/stdafx.h Normal file
View File

@ -0,0 +1 @@
void print();