首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

请网友帮小弟我看看这个程序错在哪里

2013-04-26 
请网友帮我看看这个程序错在哪里如题。虽然编译器提示了很我错误,但是我还是找不出来。请求帮助。这个程序就

请网友帮我看看这个程序错在哪里
如题。虽然编译器提示了很我错误,但是我还是找不出来。请求帮助。这个程序就是练习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
[解决办法]

引用:
#define SIZE 40
#define LIM 5;
难道看不出这句有啥错?
LIM后面还能加分号???  删掉就ok

++

热点排行
Bad Request.