cannot convert parameter 1 from 'char' to 'char []'???求解决
#include<stdio.h>intmain(){voidcal(charcode[100],int*L);intl=0;charcode[100];printf("...
#include<stdio.h>
int main()
{
void cal(char code[100],int *L);
int l=0;
char code[100];
printf("Type in code plz:\n");
scanf("%s",code);
cal(code[100],&l);
printf("The length of character is %d.",l);
return 0;
}
void cal(char code[100],int *L)
{
int i,j=0;
for (i=0;code[i]!='\0';i++) j=j+1;
*L=j;
} 展开
int main()
{
void cal(char code[100],int *L);
int l=0;
char code[100];
printf("Type in code plz:\n");
scanf("%s",code);
cal(code[100],&l);
printf("The length of character is %d.",l);
return 0;
}
void cal(char code[100],int *L)
{
int i,j=0;
for (i=0;code[i]!='\0';i++) j=j+1;
*L=j;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询