The computer and the operating system
Where a program lives while it runs
The donation count has to live somewhere while the program updates it. It helps to separate the computer's working memory from the files it keeps on storage.
- Storage, such as a drive, holds saved files, including programs.
- Memory, often called RAM, holds instructions and working values while a program runs.
- The processor, or CPU, carries out instructions such as adding two counts or comparing them.
The operating system is the software that starts programs and manages shared resources. It arranges access to memory, files, and devices. A terminal is a text window where a program can display output; you do not need to know how the screen hardware works to print a message.
When a program finishes, its working values are not automatically saved. If the workshop's total exists only in memory, running the program again does not recover that total. Saving to a file is a separate action; printing the total alone does not save it for the next run.
In the next lesson, we'll distinguish the C text you write from the executable file that the computer can run.