怎么定义一个二位字符串数组?
我是用char*[][]定义了一个二位字符串数组,不过在进行动态存储的时候总是存储出错,前面的被覆盖掉了。搞不明白,求帮忙
'我大概是这样用的~很正常阿~
#include "stdafx.h"
char All[Straight][sHorizontal];
int AAA()
{
while(???)
{
if(???)
{
jj=0;
jj+=sprintf(All[count]+jj, "AAA: %d|%d|%d", S_len,CPU_Type,STDF_VER);
......
count++;
}
else if (???)
{
jj=0;
jj+=sprintf(All[count]+jj, "\nAAA: %d|%d|%d", S_len,CPU_Type,STDF_VER);
......
count++;
}
else if (???)
......
......
......
if((count==Straight)||((CN_BUFFER_SIZE+1)==(unsigned)i))
{
int num;
stream1 = fopen(stParam.SaveFile, "a+" );
for(num=0;num<count;num++)
fprintf(stream1,"%s",All[num]);
fclose(stream1);
memset(All,0,sizeof(All));//清空All
count=0;
}
}
free (All);
return 1;
}
char*[][]是三位吗?