void SetAt( int nIndex, TCHAR ch );ParametersnIndexZero-based index of the character in the CString object. The nIndex parameter must be greater than or equal to 0 and less than the value returned by GetLength. The Debug version of the Microsoft Foundation Class Library will validate the bounds of nIndex; the Release version will not.chThe character to insert.
CString str[10]说的是10个CString型的数据不知你要问占内存的长度,还是什么样的长度
CString 不需要指定长度。那么用SetAt(i,'a')怎么会出错?//如int i = 3;
要保证这个String的长度在4个字符以上,才可以
要保证这个String的长度在4个字符以上,才可以保证,怎么保证?不还是初始或者指定它的长度吗?
CString str("", nLength);
nLength 就是你需要的长度,如1024
在“ ”内有一个NULL,所以下一次得到它的长度时,就是“ ”内NULL前的长度,
所以用‘ ’比较好。