S
sunway
i have written a small program, it turns out to be wrong,
while(read()!=EOF){
read();
read();
read();
}
so,when read==EOF,the next read() will read a -1, and the program will go
infinitely.
but,when i use ^c to abort the program,the output file's size is
always 4096 bytes.why? notice that the program is always writing
that file. the buffer should be flushed again and again.
while(read()!=EOF){
read();
read();
read();
}
so,when read==EOF,the next read() will read a -1, and the program will go
infinitely.
but,when i use ^c to abort the program,the output file's size is
always 4096 bytes.why? notice that the program is always writing
that file. the buffer should be flushed again and again.