diff --git a/cpp/vscode-test/.vscode/launch.json b/cpp/vscode-test/.vscode/launch.json new file mode 100644 index 0000000..23e633e --- /dev/null +++ b/cpp/vscode-test/.vscode/launch.json @@ -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" + } + ] +} \ No newline at end of file diff --git a/cpp/vscode-test/.vscode/tasks.json b/cpp/vscode-test/.vscode/tasks.json new file mode 100644 index 0000000..974acef --- /dev/null +++ b/cpp/vscode-test/.vscode/tasks.json @@ -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" +} \ No newline at end of file diff --git a/cpp/vscode-test/main b/cpp/vscode-test/main new file mode 100644 index 0000000..bf54dad Binary files /dev/null and b/cpp/vscode-test/main differ diff --git a/cpp/vscode-test/main.cpp b/cpp/vscode-test/main.cpp new file mode 100644 index 0000000..0e8c3c5 --- /dev/null +++ b/cpp/vscode-test/main.cpp @@ -0,0 +1,8 @@ +#include +#include "stdafx.h" + +int main(int argc,char *argv[]){ + printf("hello vscode\n"); + print(); + return 0; +} \ No newline at end of file diff --git a/cpp/vscode-test/stdafx b/cpp/vscode-test/stdafx new file mode 100644 index 0000000..6651510 Binary files /dev/null and b/cpp/vscode-test/stdafx differ diff --git a/cpp/vscode-test/stdafx.cpp b/cpp/vscode-test/stdafx.cpp new file mode 100644 index 0000000..60e482a --- /dev/null +++ b/cpp/vscode-test/stdafx.cpp @@ -0,0 +1,8 @@ +#include + +void print(){ + fflush(stdin); + char str[57]; + fgets(str,sizeof(str),stdin); + printf("%s\n",str); +} \ No newline at end of file diff --git a/cpp/vscode-test/stdafx.h b/cpp/vscode-test/stdafx.h new file mode 100644 index 0000000..b669ed4 --- /dev/null +++ b/cpp/vscode-test/stdafx.h @@ -0,0 +1 @@ +void print(); \ No newline at end of file