请网友帮我看看这个程序错在哪里
如题。虽然编译器提示了很我错误,但是我还是找不出来。请求帮助。这个程序就是练习strcpy的。
#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#define SIZE 40
#define LIM 5;
int main(void)
{
char words[LIM][SIZE];
char temp[SIZE];
int i;
for(i=0;i<LIM;i++)
{
gets(temp);
if(temp[0] == 'q')
{
strcpy(words[i], temp);
}
else
{
printf("%s does't begin with 'q'.", temp);;
}
}
for(i=0;i<LIM;i++)
{
puts(words[i]);
}
return 0;
}
[解决办法]
你把开头改成这样的就可以通过#include "stdio.h"
#include "string.h"
#define SIZE 40
#define LIM 5
,但是我没有具体分析你要输出什么,只是改了一下,可以让他通过编译,好像你的程序后面也有点问题
[解决办法]
#define SIZE 40
#define LIM 5;
难道看不出这句有啥错?
LIM后面还能加分号??? 删掉就ok
[解决办法]