+ 2
Write a program to copy its input to output, replacing each each string of one or more balnks with a signle blank. This is C.
Ive been using the while function, getchar and putchar. Im having trounle grasping the question though. Thanks
3 Respostas
0
To get an entire line you can use fgets(), like so:
char line [10];
fgets(&line, 10, stdin);
then you can check if a string starts witb ' ', if so then on that position put a single ' ' and move on to the next string .
0
So i end up doing manually ?
0
I mean...i dont think there is a function that does this so yes...and btw, while is a loop, not a function.