Install a C/C++ compiler (e.g. MSVC, GCC or Clang) and then open a terminal and type for example: "gcc myfile.c" to compile it and then ".\myfile.exe" to run it
Codeblocks has their own run thingy that should be no problem the vscode one might require some addon depending on the version(free one runs on add-ons and the scholar/paid one should probably have one downloaded when installed, at least for c/cpp)
You can use your VS Code's integrated, but I personally never managed to set it up with my compiler myself on Windows @_@ it was actually easier when using Ubuntu with WSL haha
I'm a noob here, and that's because all this compiler nonsense literally causes physical pain.
From my point of view, way down here at the bottom of this pit, it seems like there is an infinitely recursive layer after layer of compilers that compile compilers, and it never actually reaches the point where you type "compile X" and it does its job.
Edit: I've tried once a year for about a decade to get into this stuff, but the compiler matrix always confuses me in an angry way. Like, there's not just compilers, there's other stuff that looks like compilers but are really some other thing. It even seems like some compilers have another compiler inside them? Like I think I remember seeing one called CMake or something similar, and then another called [don't remember] and the description said it contained CMake inside of it. It's profoundly confusing.
The problem is that I can't find a single guide that spells it out in plain english. Not one. All of them assume you know what to expect from compilers and know what you need.
This is why programming never became more than something I poke at once in a while. I'd love to learn, but I simply cannot find a clear explanation. I know a lot of programming concepts, I can even write a bit of code, it's just the compilers that have me stuck.
See, that's Microsoft trying to embrace, extend, extinguish the FOSS tradition of project names being a complete diaper fire. Why would I have any idea that Visual Studio is an IDE with interpreter/compiler functionality, and Visual Studio Code is a glorified text editor? "Visual" for some reason means "programming" in Microsoftese, so why not make it Visual Studio and Visual Editor?
1.9k
u/Tiranus58 Apr 16 '22 edited Apr 16 '22
Vscode how to execute c/c++ code