online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include <vector> #include <list> using namespace std; void testVector (); void testList (); template < class InputIterator, class T > T sum (InputIterator first, InputIterator last, T start) { while (first != last) { start += *first++; } return start; } int main () { testVector (); testList (); return 0; } void testVector () { vector < int >v; v.push_back (1); v.push_back (2); v.push_back (3); v.push_back (4); cout << "Sum of Vector v is : " << sum (v.begin (), v.end (), 0) << endl; } void testList () { //for list list < double >l; //creat a double type list l.push_back (10); //pushing data into list l l.push_front (11); //pushing data into list l l.push_back (9); //pushing data into list l l.push_front (12); //pushing data into list l l.push_back (8); //pushing data into list l // list<double>::iterator itlist; cout << "Sum of List L is : " << sum (l.begin (), l.end (), 0.0) << endl; }

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