1.可以改成strcpy((char*)&date[top],d);
2.个人认为你代码要改要不会出问题的,也完成不了你想要的工作。
1) char date[MAX]; -->char date[MAX][16];
2)strcpy((char*)&date[top],d);--> strcpy(((char*)&date[top][0],d);
3)在void bankin(char d[],int m)函数里加上,要不会出现内存越界
{
if(top < MAX)
{
......................
}
}
date[top]是一个字符常量,你现在的意思是相当于把一个字符串复制给一个字符,是不对的。
改成date就可以,因为它是char *的数据类型。
date[top]代表一个字符,改成strcpy(date,d);