online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <vector> #include <algorithm> #include "ex13_31.h" int main(void) { HasPtr s{ "s" }, a{ "a" }, c{ "c" }; std::vector<HasPtr> vec{ s, a, c }; std::sort(vec.begin(), vec.end()); for (auto const& elem : vec) elem.show(); return 0; }
#pragma once #include <string> #include <iostream> class HasPtr { public: std::string ps; int i{}; bool operator<(const HasPtr& r)const noexcept { return ps < r.ps; } void show() const { std::cout << ps << 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