主页
C++
C++ 字符串长度
demo_strings_size
运行 ❯
×
更改方向
保存代码
更改主题
#include
#include
using namespace std; int main() { string txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; cout << "The length of the txt string is: " << txt.size(); return 0; }
The length of the txt string is: 26