程序如下,你懂的。 #include <afxwin.h> #include <iostream> int main(int argc, char **argv) { CString str = "风云"; int len = str.GetLength(); int size = 0; #ifdef _UNICODE USES_CONVERSION; size = strlen(W2A(str)); #else size = str.GetLength(); #endif std::cout << size << std::endl; return 0; }