CPS 6, Ramm - Spring 2000 - 3/20/00 #23
Chap 8. Arrays, Data, & Random Access
- Arrays (built-in)
- Overview
- Syntax
- Size known at compile time.
- Initializaton
- No range checks
- Parameters
- Assignment
- Keeping track of size
- Will not use
Chap 9. Strings, Streams, and Operators
- Strings are Vectors of Characters
- Use indexing operator [] to get char
- Don't get out of range!
- Can both access and change characters
- Can also access characters (as strings) with .substr(pos,len)
- Reverse Order of Characters in a String
- Convert Characters to Strings
- Strings with one element are not characters.
- Can convert char to string using string(char)
-
capital.cpp
- String Streams
- Read from String as if it were a file.
- Use getline() to
read line from file stream or cin
- Use istrstream to
read info from string.
- Daily Sales Ticket Processing