C++ Sandbox Template

With the Next Tech Sandbox, get started with writing C++ in just a couple seconds without having to download anything.

Just click here to launch a C++ sandbox: https://nt.dev/cpp

Each C++ sandbox is backed by a real coding environment, so you don’t have to worry about downloading anything.

Here’s some of the software that comes pre-installed:

  • The C++ programming language (gcc)
  • CMake command-line interface (make)

Each time you click the blue “Run” button, we’ll automatically execute these commands to compile and run your code:

rm -f a.out
g++ -Wall -std=c++0x {{filenames}}
./a.out

If you want to get started with some code, just copy and paste this into your sandbox:

#include <iostream>

using namespace std;

int main() {
    int x, y;
    cout << "Please enter a number:" << endl;
    cin >> x;

    cout << "Please enter another number:" << endl;
    cin >> y;

    cout << "The sum is " << x + y << endl;
    cout << "The difference is " << x - y << endl;
    cout << "The product is " << x * y << endl;
    cout << "The quotient is " << x / y << endl;
    return 0;
}

You can create an unlimited number of sandboxes, each storing up to 50MB of files. Any files you create in a sandbox are automatically backed up for you. You can upload any files you’re already working on and then download your files at any time to continue working outside the sandbox, submit to your teacher, or add to your portfolio.