vs code debug c++ java (mac)

C++

{
    // 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": "(lldb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/a.out",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "lldb",
            "preLaunchTask": "build foocpp",
        }
    ]
}
{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build foocpp",
            "type": "shell",
            "command": "g++",
            "args": [
                "-g","-std=c++14", "${workspaceRoot}/*.cpp"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}
#include<iostream>
#include<memory>
#include "foo.h"
using namespace std;
int main(){
    shared_ptr<int> p = make_shared<int>(1); 
    unique_ptr<float> u = make_unique<float>(2.0);
    auto x =1;
    std::cout<<"Hello World!";
    for(int i=0;i<100;++i){
        std::cout<<i<<'\n';
    }
    return 0;
}

Java

猜你喜欢

转载自www.cnblogs.com/Searchor/p/9924659.html