Wk. 6 Flashcards
What is the const modifier for?
Used to create “read-only” variables
What is the syntax for a const modifier?
const [data types] [identifier]
Besides const, what other type of variable must be initialized?
Reference variable
What is an example where you would utilize a const variable?
When you have a global variable that is going to be used multiple times. The const will prevent any function from changing the value of the variable.
When are variables written in all caps?
When a variable is a defined constant.
How do you tell whether to use ifstream or ofstream?
POV of the program. If reading from file into the program, ifStream. If writing from program to the file, ofStream.
What signifies the end of a char array?
The null character - \0