Chapter 2 - Flow of Control Flashcards
1
Q
Inkluderer her enum-type. men resten av kapitlet bør også inn.
A
ok
2
Q
What is an enumeration type?
A
An enumeration type is a type whose values are defined by a list of constants of type int. An enumeration type is very much like a list of declared constants.
3
Q
What is the syntax for enum types?
A
enum Direction { NORTH = 0, SOUTH = 1, EAST = 2, WEST = 4).
4
Q
What happens if you don’t give a number to each element in your enum list?
A
They are given values according to their placement in the list. (0 -> ).