The following code inserts “~” in a text file. However when it reads and finds a ½, ¼, £ and o (degrees),the program halts.
Any ideas ?
#include <stdio.h>
main()
{
/* char buffer [ BUFSIZ ]; */
char ch;
while ( (ch = getchar()) >= 0 )
{
putchar ( ch );
if ( ch == 10 )
puts ( "~" );
}
}