c语言问题求助

[复制链接]
查看11 | 回复1 | 2011-5-10 06:21:51 | 显示全部楼层 |阅读模式
#includestdio.h
#defineN80
voidmain()
{
voidcount(charstr[N],int*cap,int*low,int*space,int*num,int*oth);
charstr[N];
inta=0,b=0,c=0,d=0,e=0;
int*cap,*low,*space,*num,*oth;
cap=
low=
space=
num=
oth=
printf(\"输入一个字符串\\n\\n\");
gets(str);
count(str,cap,low,space,num,oth);
printf(\"\\n\\n大写字母个数为:%d\\n\\n小写字母个数为:%d\\n\\n空格个数位:%d\\n\\n数字个数为:%d\\n\\n其他字符个数为:%d\\n\\n\",*cap,*low,*space,*num,*oth);
}
voidcount(charstr[N],int*cap,int*low,int*space,int*num,int*oth)
{
inti;
for(i=0;str!=\'\\0\';i)
{
if(str[
zhaohuantong(赵焕同)12:58:52
i]=\'A\'=\'Z\')(*cap);
elseif(str=\'a\'=\'z\')(*low);
elseif(str==\'\')(*space);
elseif(str=\'0\'=\'9\')(*num);
else(*oth);
}
}
为什么出现extraparameterincalltocount和typemismatchinredeclarrtionof‘count’错误。谢谢!
回复

使用道具 举报

千问 | 2011-5-10 06:21:51 | 显示全部楼层
把main中voidcount(charstr[N],int*cap,int*low,int*space,int*num,int*oth);
这句声明放到外面去试试。
ps:你提问的代码,不做改动在我的vs2005上面是可以编译通过。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行