Okay, just to remind you readers, I won’t be explaining everything. If you wanna know more, search for it online, whether it be on Google or Wikipedia. It’s a pain to write too long, you know?
Moving on….
Today’s topic is about Files & Streams.
First up, Streams.
Stream is a sequence of characters. All input & output data are also considered to be a stream. C also see file as a stream. The purpose of a stream is for keeping key in data from keyboard need to be saved at secondary storage device as a data file.
When a C program runs, there are 3 types of streams that activated:
- Standard Input Stream
- Controls input from keyboard.
- Standard Output Stream
- Controls output stream to monitor.
- Standard Error Stream
- Controls error messaging.
Note: Each stream is associated with a file.
Files is basically a massive collection of bits. I’ll tell you why: First, records is a collection of fields. Field is a collection of bytes. Third, bytes is a collection of bits.
So, in short, file is a record. The rest are self-explanatory.
For more explanations, please search it yourself, like I said before.