Checkpoint 9.1.1.
Which of the following words are variables of type
Price
?
struct Price {
int dollar, cents;
};
int main() {
Price sandwich = { 3, 45 };
Price coffee = { 2, 50 };
Price pastry = { 2, 0 };
}
- sandwich, coffee, pastry
- Correct!
- dollar, cents
- Try again. We are looking for variable names not instances of a structure.
- Price, struct
- Try again. ``struct`` and ``Price`` are not variables.