You can use cling, an interactive interpreter for the C++ language based on clang/LLVM, for quick testing of small code pieces.

[cling]$ #include
[cling]$ using namespace std;
[cling]$ int a[] = {1,2,3};
[cling]$ for (int& x: a){ x += 10; }
[cling]$ for (int& x: a){ cout << x << “,”; }
11,12,13,
It supports both old C++03 and new C++11 standards fine!
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s