online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> //cout #include <sstream> #include <string> #include <algorithm>// std::reverse using namespace std; unsigned short int minNumber = 1; unsigned long int maxNumber = 9999999999999; string getUserInput(); int main() { string userInput = getUserInput(); string reverseInput = userInput; reverse(reverseInput.begin(), reverseInput.end()); cout << "The Number is "<< userInput << endl; cout << "It has "<< userInput.size() << " digits " << endl; cout <<"The number is " << userInput <<" and its reverse is " << reverseInput << endl; return 0; }; string getUserInput() { long userNumber=0; do { cout <<"Type a number between" << minNumber << " and " << maxNumber << endl; cin >> userNumber; if(cin.fail()) { cout << "Please type a number" << endl; cin.clear(); cin.ignore(numeric_limits<streamsize>::max(), '\n'); userNumber = 0; } } while (userNumber < minNumber || userNumber > maxNumber); ostringstream oss; oss << userNumber; std::string userInputStr = oss.str(); return userInputStr; };

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