Hello
I have this as my standard input:
Buffalo Bill's
defunct
who used to
ride a watersmooth-silver
stallion
and break onetwothreefourfive pigeonsjustlikethat
( one tab on 3rd and 4th lines, 3 tabs on 5th line)
and my cod is this:
Code:
#include <stdio.h>
#include <stdlib.h>
main(){
File* fptr;
int c;
fptr = fopen( "poetery.out", "w");
while ( getchar() != EOF )
if( ( c = getchar() ) != EOF )
fputc( c, fptr );
fclose(fptr);
return EXIT_SUCCESS;
}
output is:
ufl ilsdfnt h sdt
rd aesot-ivr tlinadbekoewtreoriepgosutieht
can anybody explain why it does this? it's an excersize from a book, question and solution, but it doesn't explain why, and I can't figure out what is happening.
Thank you