online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> /** * Returns a new string trimming spaces from front and back * @param str The original string */ std::string trim(const std::string &str) { std::string s(str); while (s.size() > 0 && std::isspace(s.front())) { s.erase(s.begin()); } while (s.size() > 0 && std::isspace(s.back())) { s.pop_back(); } return s; } int main() { std::cout << trim(" 3 Hello World 3 \n"); if (trim("\t 3 Hello World 3 \n") == "3 Hello World 3") { std::cout << "- trim removed line returns too!"; } return 0; }

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