online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <iostream> #include <vector> int splitWord(const std::string & word ) { std::vector<std::string> characters; int num = word.size(); int i = 0; while(i < num) { int size = 1; if(word[i] & 0x80) { char temp = word[i]; temp <<= 1; do{ temp <<= 1; ++size; }while(temp & 0x80); } std::string subWord; subWord = word.substr(i, size); characters.push_back(subWord); i += size; } return characters.size(); } int main() { std::string name; std::string a = "这是Liferecords编写的C++第1个程序!"; std::cout<< splitWord(a) << "\n"; }

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