C语言中出现cannot convert parameter 1 from 'char [9][3]' to 'char []'

源代码为#include<stdio.h>#include<string.h>voidchangeinto(chara[],charb[]);charmoney[][4]... 源代码为#include <stdio.h>
#include <string.h>
void changeinto(char a[],char b[]);
char money[][4]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char a[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿"};
void main()
{

char b[10];
printf("please input money\n");
gets(b);
changeinto(a,b);

}
void changeinto(char a[],char b[])
{
int i,j=0,n=strlen(b);
for(i=0;i<n;i++)
j=a[i]-'0';
printf("%s",a[j]);
}
展开
 我来答
匿名用户
2011-11-29
展开全部
编译问题是改好了,但是你的程序逻辑有问题,自己找一找吧,
#include <stdio.h>
#include <string.h>
void changeinto(char b[]);
char money[][4]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char a[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿"};
void main()
{

char b[10];
printf("please input money\n");
gets(b);
changeinto(b);

}
void changeinto(char b[])
{
int i,j=0,n=strlen(b);
for(i=0;i<n;i++)
j=a[i][0]-'0';
printf("%s",a[j]);
}
提示一下:
钱数依次取最高位,将最高位值和money匹配,将最高位的位数和a匹配
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
笃侠6A
2011-11-29 · TA获得超过3734个赞
知道大有可为答主
回答量:3205
采纳率:75%
帮助的人:3262万
展开全部
有几个错误,注意注释处:
#include <stdio.h>
#include <string.h>
void changeinto(char (*a)[3],char b[]); /* a[] */
char money[][4]={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
char a[][3]={"元","拾","佰","仟","万","拾","佰","仟","亿"};
void main()
{

char b[10];
printf("please input money\n");
gets(b);
changeinto(a,b);
}
void changeinto(char (*a)[3],char b[]) /* a[] */
{
int i,j=0,n=strlen(b);
for(i=0;i<n;i++){
j=b[i]-'0'; /* a[i] */
printf("%s",a[j]);}
}
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2011-11-29
展开全部
参数传递要匹配,二维不能传给一维
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式