Adds cpp demo.
This commit is contained in:
1
demos/cpp/.gitignore
vendored
Normal file
1
demos/cpp/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
main
|
||||
29
demos/cpp/.vscode/launch.json
vendored
Normal file
29
demos/cpp/.vscode/launch.json
vendored
Normal 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": "g++ build active file",
|
||||
"miDebuggerPath": "/usr/bin/gdb"
|
||||
}
|
||||
]
|
||||
}
|
||||
25
demos/cpp/.vscode/tasks.json
vendored
Normal file
25
demos/cpp/.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "g++ build active file",
|
||||
"command": "/usr/bin/g++",
|
||||
"args": [
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}/${fileBasenameNoExtension}"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "/usr/bin"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": "build"
|
||||
}
|
||||
]
|
||||
}
|
||||
14
demos/cpp/main.cpp
Normal file
14
demos/cpp/main.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
// visualize `myGraphJson`!
|
||||
string myGraphJson = "{\"kind\":{\"graph\":true},"
|
||||
"\"nodes\":[{\"id\":\"1\"},{\"id\":\"2\"}],"
|
||||
"\"edges\":[{\"from\":\"1\",\"to\":\"2\"}]}";
|
||||
cout << myGraphJson;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ See [demos](./demos/) for demos. These languages and debuggers are verified to w
|
||||
- C# using `coreclr` debug adapter: ✅ Rudimentary Support
|
||||
- PHP using `php` debug adapter: ✅ Rudimentary Support
|
||||
- Java using `java` debug adapter: ✅ Rudimentary Support
|
||||
- C++ using `cppdbg` debug adapter: ✅ Rudimentary Support
|
||||
|
||||
All other languages and debuggers might work too.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user