online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <fstream> #include <sstream> int main() { std::ifstream inputFile("input.txt"); std::string line; int num = 0, sum = 0; //always initialize built in types in local/block scope if(inputFile) { //go line by line while(std::getline(inputFile, line)) { std::istringstream ss(line); //go through individual numbers while(ss >> num) { sum += num; } } } else { std::cout<<"Input file cannot be read"<<std::endl; } inputFile.close(); std::cout << "The sum of all the intergers from the file is: "<<sum<<std::endl; return 0; }
1 2 3 4 5 6

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