Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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)?

like image 912
Felix Dombek Avatar asked Nov 23 '11 22:11

Felix Dombek


People also ask

What is the fastest writing method?

Tip: Cursive handwriting is often faster than print. More connected letters allow for a smoother and faster transition between words.


2 Answers

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.

like image 79
Andrew Durward Avatar answered Oct 11 '22 06:10

Andrew Durward


"really, really quick (and dirty, throw away?) programming "?

  • Compiler : VC++ command line - you already have it.
  • Editor: Notepad or somesuch
  • Compilation process: A .BAT file you write once and supply a parameter with the name of the single source file.
  • Location: Set up some desktop shortcuts to a known directory for your test code.
like image 43
Keith Avatar answered Oct 11 '22 05:10

Keith