Fastest way to write & compile a C/C++ program in Windows

Felix Dombek picture Felix Dombek · Nov 23, 2011 · Viewed 53.3k times · Source

I'm usually using Visual Studio, but several things bother me when I just quickly want to test some code:

  • it has a rather long startup time
  • it always needs a project to execute/debug files
  • program output gets printed to the console, but the window simply closes when I don't insert a getchar() or a breakpoint in the program and thus I'm not seeing it.

I'm looking for a program which is suitable for a really, really quick programming in Windows. Such as, copying some code from an SO question, running it and seeing its output.

I don't think that console programs or g++ under CygWin are a good solution, because there it takes ages to cd into the right dir to save the file, I'm not used to editors such as Vim, and typing in the compiler commandline myself has always annoyed me etc.

So I guess what I'm looking for is a very lightweight free C/C++ IDE which is preconfigured to work with a free compiler (bonus points if it is even shipped with it.)

What can you recommend which adresses at least two items from the list above?

Is there maybe even a program which can execute/interpret C or C++ in an interactive commandline (like Python)?

Answer

Andrew Durward picture Andrew Durward · Nov 24, 2011

I'm looking for a program which is suitable for a really, really quick programming in Windows. Such as, copying some code from an SO question and executing it and seeing it's output.

For quick-and-dirty experimental coding, I really like codepad.org. Not having to create a file is especially nice as it saves me from coming up with a suitable name and disk location. Be aware that it uses g++ 4.1.2 behind the scenes so some of the latest C++11 features aren't supported.