在VB中求长度
Dim s$
s = "珠海s市"
x = Len(s)
得出x=4 但在VC中
CString s ;
s = "珠海s市" ; int len = s.GetLength() ; 得出s=7如果我在VC中求出的长度也等于4该怎么计算呢 ??
Dim s$
s = "珠海s市"
x = Len(s)
得出x=4 但在VC中
CString s ;
s = "珠海s市" ; int len = s.GetLength() ; 得出s=7如果我在VC中求出的长度也等于4该怎么计算呢 ??
_mbstrlen取得长度。
在vc中
#include<stdlib.h>
int main(int argc, char* argv[])
{
setlocale(LC_ALL,"chs");//设置区域
cout<<_mbstrlen("中文s阿")<<endl;
return 0;
}