CS161_Topic#13

CS161_Topic#13 - CS161 CS161 Introduction to Computer...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CS161 CS161 Introduction to Introduction to Computer Science Computer Science Topic #13
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS161 Topic #13 2 Today in CS161 External Files What is an external file? How do we save data in a file? Discuss Program #5 Questions? Next time: How do we read data from a file?
Background image of page 2
CS161 Topic #13 3 External Files • So far, all of our programs have used main  memory to temporarily store information.  • In addition, all input and output has been done  with standard-in and standard-out devices – this includes input from the keyboard and  output to our terminal's screen for prompts,  echoing data, and displaying results • Now it is time to work with secondary storage!
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS161 Topic #13 4 External Files • Typically, secondary storage consists of a hard  disk. ...however,  some of you may end up using a floppy as your secondary storage. With ODIN, we will be using a hard disk. Those of you using PCs, will use a combination of hard disks and floppies.
Background image of page 4
CS161 Topic #13 5 External Files • There is one big difference between main  memory and secondary storage.  • Remember with main memory, each time we run  our program the value of our variables is lost and  we start from scratch (i.e., we don't remember  what the values of the variables were when we  last ran the program).  • Also, when we power down the computer all of  the data stored in main memory goes away.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS161 Topic #13 6 External Files: Secondary Storage • With files, when you finish executing a program,  the data no longer goes away!  • It stays around so you can access it the next time  you run your program.  • Plus, when your computer is powered down,  information stored in secondary storage is not lost  (unless you have a disk crash or failure!).  • Therefore, secondary storage can be used to store  data for as long as it is needed.
Background image of page 6
CS161 Topic #13 7 External Files: Secondary Storage
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/17/2010 for the course CS 161 taught by Professor Fant during the Winter '08 term at Portland State.

Page1 / 24

CS161_Topic#13 - CS161 CS161 Introduction to Computer...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online