Which Streams are use for File Input/Output In C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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.

13th Jul 2021, 4:42 AM
Suraj
Suraj - avatar
4 Answers
+ 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.
13th Jul 2021, 8:02 AM
Hatsy Rei
Hatsy Rei - avatar
0
Hatsy Rei : Thanks for response. It means It is false that standard streams only use of Terminal Input output.
13th Jul 2021, 8:40 AM
Suraj
Suraj - avatar
0
Hatsy Rei : what's the difference between standard streams and binary/text streams?
13th Jul 2021, 8:43 AM
Suraj
Suraj - avatar
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
13th Jul 2021, 9:01 AM
Suraj
Suraj - avatar