So I've been learning C++ and all my practice was done in vs code so far. However, when I got to the OOP stuff I couldn't compile multiple files all at once with the extension. So, I googled how to do it and everywhere I went I found it can be done with tasks. It took me hours to find the right code for the tasks.json file that actually works. However, it can only compile and I manually have to run the .exe file. Obviously I wanna do both but I have no idea how. I just need the extra bit that allows the task to run the file after it is compiled. I looked up the documentation for tasks with vs code, but it is very confusing and makes no sense to me at all. I wanna learn C++ not how to do tasks.json lol. Hopefully, someone can help me. If you are gonna tell me to look up the documentation or something don't say anything at all because I am not posting this to have people tell me look up the documentation because that documentation is garbage.
Here is the current tasks.json that can only compile:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C++ Compile",
"command": "C:\\Program Files\\mingw-w64\\mingw64\\bin\\g++.exe",
"args": [
"-g",
"${fileDirname}\\*.cpp",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Thank you for your time, and any help is appreciated.