online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #include <string> using namespace std; int main() { string s1 = "ab\0\0cd"; // s1 contains "ab", using string literal string s2{"ab\0\0cd", 4}; // s2 contains "ab\0\0cd", using different ctr string s3 = "ab\0\0cd"s; // s3 contains "ab\0\0cd", using ""s operator (since C++14) cout << s1 << endl; cout << "size: " << s1.size() << "\n"; cout << "length: " << s1.length() << "\n"; cout << "capacity: " << s1.capacity() << "\n"; cout << "max_size: " << s1.max_size() << "\n\n"; cout << s2 << endl; cout << "size: " << s2.size() << "\n"; cout << "length: " << s2.length() << "\n"; cout << "capacity: " << s2.capacity() << "\n"; cout << "max_size: " << s2.max_size() << "\n\n"; cout << s3 << endl; cout << "size: " << s3.size() << "\n"; cout << "length: " << s3.length() << "\n"; cout << "capacity: " << s3.capacity() << "\n"; cout << "max_size: " << s3.max_size(); 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