问题描述
- 数组指针,指针数组 ,存储方式
-
(1) int i; char p[3] = {"妹"}; CString str; str.Format("%s, ",p); (2) char *pch[6]={"妹","妹","你","做","船","头"}; for(int i=0;i<6;i++) { CString str; str.Format("%s, ",*(pch+i)); } (3) char charray[][3]={"妹","妹","你","做","船","头"}; char (*pchArray)[3]=charray; for(int i=0;i<6;i++) { CString str; str.Format("%s, ",*(pchArray+i)); }
解决方案
一个汉字占用2个char,你的空间分配不够
时间: 2024-12-27 15:33:54