I want to check for valid characters numbers and letters
so I created a function called is_separator.
but when I call it, it gives and 2 errors and 1 warning
Line numbers are shown in code below as comments
Error Line 55, conflicting types for is_separator.
then a warning below that error:
warning Line 55, Note: an argument type that has a default promotion can't match an empty parameter name list declaration.
then another error line 24
Error Line 24: previous implicit declaration of 'is_separator' was here
DougP
< I Built one
so I created a function called is_separator.
but when I call it, it gives and 2 errors and 1 warning
Line numbers are shown in code below as comments
Error Line 55, conflicting types for is_separator.
then a warning below that error:
warning Line 55, Note: an argument type that has a default promotion can't match an empty parameter name list declaration.
then another error line 24
Error Line 24: previous implicit declaration of 'is_separator' was here
Code:
void word_reverse( char* str ){
int a;
char m;
int isvalidchar;
printf("sizeof %d\n",strlen(str));*/
/* check each character one at a time */
for (a = strlen(str) ; a >= 0 ; a-- ){
m=str[a];
isvalidchar=is_separator(m); [COLOR=red]/* line 24*/[/color]
if (isvalidchar=0){
/* character is not a alpha or number */
printf("Is NOT a valid character%c");
}
else{
/* character is an alpha or number */
printf("IS a valid character%c");
}
printf("m=%c\n", m);
}
}
int is_separator( char data ){ [COLOR=red]/* line 55 */[/color]
return ( !isalnum(data) );
}
DougP
< I Built one