Run C++ in command prompt - Windows

前端 未结 11 1620
逝去的感伤
逝去的感伤 2020-12-22 19:02

I know that everyone uses an IDE nowadays, but I just find it simpler to write my code in notepad++, compile it using a command prompt command, and run it from there too. At

11条回答
  •  一生所求
    2020-12-22 19:25

    Sure, it's how most compilers got started. GCC is probably the most popular (comes with most flavors of *nix). Syntax is just gcc my_source_code.cpp, or gcc -o my_executable.exe my_source_code.cpp. It gets more complicated, of course, when you have multiple source files (as in implementation; anything #included works automatically as long as GCC can find it).

    MinGW appears to be a version of GCC for Windows, if that's what you're using. I haven't tried it though.

    Pretty sure most IDEs also include a command line interface. I know Visual Studio does, though I have never used it.

提交回复
热议问题