2 d1319997372 d1319997372 于 2014.09.11 11:09 提问

数组指针,指针数组 ,存储方式
  (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));
 }

1个回答

oyljerry
oyljerry   Ds   Rxr 2015.01.01 23:40

一个汉字占用2个char,你的空间分配不够

Csdn user default icon
上传中...
上传图片
插入图片