Online C++ Compilers

I must confess, at first I was skeptical  the usefulness of an online C++ compiler.  While I’m not quite ready to develop an entire project using an online  environment, I do find that an online C++ compiler is a handy tool to have around. I use it as a scratchpad  when I am considering coding strategies, It is also helpful when you’re  collaborating with a colleague  or want to   illustrate a point  without  going to the trouble of creating compiling and linking a small C++ program.

here are few sites I found useful:

cpp.sh:

With its short and easily  remembered URL this online compiler is my go-to tool for quick jotting.
The behind the scenes compiler is g++ (GNU C++ compiler),  the website offers  limited and uncomplicated control over the  compiler switches.

webcompiler.cloudapp.net

This  website is maintained by the visual C++  team at Microsoft,  as  you can expect it hosts the latest version of  Visual C++ (currently 2015).
The web interface is very basic , it lets you  pass  command line arguments to the compiler with some limitation.    However if VC is your primary work tool and you want  to try out  a code snippet, it’s a good tool to try.

tutorialspoint.com:

an online C++ compiler is just a small part of what this website has to offer,  it is an amazing playground for  nearly 100 online languages   IDE’s   no registration needed!
As the site name suggests  there it offers a large selection of online tutorials covering nearly every aspect of software development.
Among  the available IDE’s  there are three   C++ IDEs,  which are in fact the same interface   pre-configured to comply with  three different C++  standard versions.  As you get full access to the  g++ command line you can easily swap between  supported standards at any given “IDE”  simply by changing the  command line’s   -std   switch.  For instance
  g++ -std=c++17 -o main *.cpp  will compile your program with C++ 17 compiler although it is no listed  as an available  IDE.
clicking the compiler button on the top of the editor area, generate a command line in the terminal pane ,  you can modify.

 

ideone.com

This is another site offering a selection of over 60+ online compilers for different  languages. However what makes this website stand out is how easy it is to privately share the source with the entire build environment.   each virtual IDE has its own URL (click run to generate  the unique  address).  There is no need to register or login to share your  code.  Once you share the  URL the receiver can view your code or fork it to a new IDE (with new ULR) to  run or modify it.
the compiler powering the online IDE is  g++  or clang

Rextester

This site takes code sharing to the next level and allows multiple developers to modify  the same code at the same time (think google docs for developers). It offers a simple solution if want to discuss a code  with a  remote colleague without the hassle of sharing your desktop.  there is a  small selection of different languages  online environments. For C++  you have  a choice between g++ , clang  or VC++ 2015 compilers  (at this time).

Onlinegdb

This is a C++ compiler / Debugger combo that will actually let you debug your code online!   the compiler is g++ supporting  C++ 98 and C++ 14.
clicking debug opens a gdb terminal windows where you can some do some online debugging of your program:

Many thanks to Rajan for letting me know about this gem!

final note

Online C++ compilers are a handy tool to have in your virtual toolbox ,  however,  it worth pointing out that the code you are submitting is saved and compiled on an unknown remote machine, you should be wary of submitting sensitive code,  you wouldn’t feel safe posting on an  online C++ discussion forum.

 

2 thoughts on “Online C++ Compilers”

Leave a Reply

Your email address will not be published. Required fields are marked *