Chapter 2 - Flow of Control Flashcards

1
Q

Inkluderer her enum-type. men resten av kapitlet bør også inn.

A

ok

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the syntax for enum types?

A

enum Direction { NORTH = 0, SOUTH = 1, EAST = 2, WEST = 4).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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 -> ).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly