I have a few questions about C syntax.
ch = (char *) malloc( sizeof( char ) * strlen(src) );
What do the first brackets mean (char *) ?
The (char ) at the beginning of the first statement is a typecast. By default malloc returns a void which should be fine to assign to a char*, but in other cases typecasting is required.
You are correct single quotes should be used around charaters.
Saying scanf sometimes doesn't work is a meaningless statement without example code.