online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <random> class myrandom { public: int seed_; int min_ = 0, max_ = 10; std::mt19937 gen_; // random number generator std::uniform_int_distribution<int> dist_ {min_, max_}; // random number distribution // set a random seed if no argument provide myrandom (int seed = std::random_device{}()) { seed_ = seed; gen_.seed(seed); } int get() { return dist_(gen_); } void reset () { gen_.seed(seed_); } }; int main() { myrandom randobj; for (int i=0; i<10; i++) std::cout << randobj.get() << " "; std::cout << "\n"; randobj.reset(); for (int i=0; i<10; i++) std::cout << randobj.get() << " "; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue