Files are used for two main reasons:
-
Long term storage: To store data while the programs that
use is are not running.
-
Short-term storage: To store temporary data that is too big for
an, or is not accessed often enough to warrant keeping it
in an array.