英语翻译#includevoid transLate(char * from,char * to);int main(){char num[20];char eng[11][10]={"zero","two","three","four","five","six","seven","eight","nine","ten"};int i;printf("please enter a string of number:");gets(num);for(i=0;num[i]!='\0'
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 21:37:00
英语翻译#includevoid transLate(char * from,char * to);int main(){char num[20];char eng[11][10]={"zero","two","three","four","five","six","seven","eight","nine","ten"};int i;printf("please enter a string of number:");gets(num);for(i=0;num[i]!='\0'
英语翻译
#include
void transLate(char * from,char * to);
int main()
{
char num[20];
char eng[11][10]={"zero","two","three","four","five","six","seven","eight","nine","ten"};
int i;
printf("please enter a string of number:");
gets(num);
for(i=0;num[i]!='\0';i++)
{
transLate(num,eng);
printf("、");
}
printf("\n");
return 0;
}
void transLate(char * from,char * to)
{
\x09printf("%s",to[from-'1']);
}
英语翻译#includevoid transLate(char * from,char * to);int main(){char num[20];char eng[11][10]={"zero","two","three","four","five","six","seven","eight","nine","ten"};int i;printf("please enter a string of number:");gets(num);for(i=0;num[i]!='\0'
void transLate(char * from,char * to)
{
printf("%s",to[from-'1']);
}
整个函数是错的
传入的第二个参数应该是char**to
第一个参数char*from没有转换成int类型,不可以这样使用,会造成segmentation fault