⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stringtok_std_h.txt

📁 俄罗斯高人Mamaich的Pocket gcc编译器(运行在PocketPC上)的全部源代码。
💻 TXT
字号:
/* * Same as stringtok_h.txt, but doesn't (visiably) use C functions.*/#include <string>// The std:: prefix is not used here, for readability, and a line like// "using namespace std;" is dangerous to have in a header file.template <typename Container>voidstringtok (Container &container, string const &in,           const char * const delimiters = " \t\n"){    const string::size_type len = in.length();          string::size_type i = 0;    while ( i < len )    {        // eat leading whitespace        i = in.find_first_not_of (delimiters, i);        if (i == string::npos)            return;   // nothing left but white space        // find the end of the token        string::size_type j = in.find_first_of (delimiters, i);        // push token        if (j == string::npos) {            container.push_back (in.substr(i));            return;        } else            container.push_back (in.substr(i, j-i));        // set up for next loop        i = j + 1;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -