Skip to content

File IO

Kunal Purohit edited this page Jan 13, 2018 · 6 revisions

Overview

So far, we have seen how we can write programs to accept user input through the console line during the program's execution. Programs can also communicate through stored data, such as files. We will be going over how to integrate storing/writing data to files.

New Concepts

I/O Streams

A stream is a communication channel that a program has with the outside world. It is used to transfer data ; in our case, we will be utilizing I/O Streams, which represents an input source or an output destination.

No matter how they work internally, all streams present the same simple model to programs that use them: A stream is a sequence of data.

Reading files

Some examples here

Writing files

Some more examples

Activity