#include <set> std::set<std::string> setName; int main() { std::string strName = "世界英雄aa";//中文占两个字节,英文占一个字节 const char* name = strName.c_str(); int length = strName.length();//10 length = strlen(name);//10 return 0; }
时间: 2024-10-10 14:23:40
#include <set> std::set<std::string> setName; int main() { std::string strName = "世界英雄aa";//中文占两个字节,英文占一个字节 const char* name = strName.c_str(); int length = strName.length();//10 length = strlen(name);//10 return 0; }