Set vscode to generate CPP code executable file EXE under the same path
Press F5 to generate EXE in 1.1.cpp, and the 1.1.exe generated in the result is not in the Chapter1 folder.
In the ARGS of Task.json, the modification path is: “$ {Filedirname} \ $ {FilebaseNameExtent} .exe”
is the same in launch.json.
Run 1.1.cpp again, you can see that 1.1.exe and 1.1.cpp are under the same folder.
Of course, you can also modify it to the absolute path, and store the EXE of the CPP uniformly in other positions of the computer, such as: “F: \ CPP \ EXE \ $ {FileBasenamexExEnses} .exe”.