64,683
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <mbstring.h>
int main(void)
{
const char*p="abc中国";
int n=_mbslen((unsigned char*)p);
printf("%d\n",n);
}
#include <string>
using std::string;
string x = "abcd";
int len = x.length(); //字符长度
int capacity = x.capacity;//当前容量