Previous Lecture | lect07 Slides | Next Lecture |
Code from lecture
https://github.com/ucsb-cs16-f18-mirza/cs16-f18-lectures/tree/master/lec-06
Topics
File I/O basics
- Intro to lab03
- Examining text files using 1) an editor 2) cat command
- Opening a file: open()
- Reading a line from a file: getline()
- Reading until the end of file is reached
- Detecting failures
- Printing error messages to standard error with cerr
- When do we use exit() and why?
Data representation
- How is data (numbers for now) represented in memory?
- Positional encoding (Decimal, Binary, Hex,…any base)
- Number conversions
- Big idea:
- Bits can represent anything!
- Data is stored in memory using finite number of bits (use this to determine range of values that can be stored in any type)