I wrote this program, it does successfully compile but when running it hangs. and i think the prob must be something like wrong use of function.
#include
#include
void sp_to_dash(char *str);
char s;
int main(void){
printf("Please Enter a expression: \n");
scanf("%c",s);
sp_to_dash("s");
system("pause");
}
void sp_to_dash(char *str){
while (*str)
{
if (*str==' ') printf("%c",'_');
else printf("%c",*str);
str++;
}
}
2007-04-05
11:03:51
·
4 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design
sp_to_dash(s); doesn't work too
2007-04-05
11:52:48 ·
update #1