online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <vector> template<typename iter> void bubbleSort(iter start, iter end) { for (iter &j = end; j != start; j--) { for (iter &i = start; i != end - 1; i++) { if (*i > *(i + 1)) { std::iter_swap(i, i + 1); } } } std::cout << "ended" << std::endl; // this line never gets called } int main() { std::vector<int> vector = {1, 7, 2, 3, 6, 4, 5}; std::vector<int> temp = vector; bubbleSort(vector.begin(), vector.end()); for (auto &num : vector) { std::cout << num << std::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