+ 1
Which Streams are use for File Input/Output In C
Actually I have learn about Console or Terminal Input output, where standard streams (stdin, stdout and stderr) use for transmission of data from source to destination. I want to know that which streams are use for transmission of data from File to Program or from Program to File ? I also want to know, is FILE pointer a type of stream? Because it helps in transmission of data from program to file as well as file to program.
4 ответов
+ 3
https://www.gnu.org/software/libc/manual/html_node/Standard-Streams.html
Are FILE pointers streams? When we talk about streams, we usually refer to the whole pipe which allows us to direct input data to an output location. I'd say that FILE pointers are just... pointers, which point to the output destination. They are part of the stream, but not the whole stream itself.
As you can see in the link, we are allowed to modify stdin, stdout via a fopen call to construct streams which read from or write to some file, but usually this is done by declaring a new file pointer instead of overwriting the predeclared standard streams.
0
Hatsy Rei : Thanks for response.
It means It is false that standard streams only use of Terminal Input output.
0
Hatsy Rei : what's the difference between standard streams and binary/text streams?
0
Hatsy Rei :
int fgetc( FILE *stream );
This is the prototype of fgetc(). And here 'stream' word is used and at the place of FILE *stream, we use to write FILE pointer in program. I am unable to understand this concept. Please Explain