online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <fstream> #include <vector> #include <limits> #include <stdexcept> using namespace std; int main(){ ifstream in("values"); if(!in) throw runtime_error("File \'values\' was not properly opened!"); vector<int> v; int x = 0; while( !(in >> x).eof() ){ if( !in.fail() ) v.push_back(x); else{ cout << "Invalid input\n"; in.clear(); in.ignore(numeric_limits<streamsize>::max(), ' '); } } for(int val : v) cout << val << ", "; }
5 7 23 16 81 v 1474 119 21 29 5 88*

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