Variables Flashcards

1
Q

What is initialisation?

A

This is where you declare the value of a variable when you first declare it. This sets the value immedietly.
e.g. float radius = 1.0;

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

What is the constructor method?

A

This is where you declare a variable and then assign it a value later.

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

What is the issue with not initialising a variable immedietly?

A

The variable gets given a random value

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

What does Enum stand for?

A

This is an Enumerated type

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

What is an Enum?

A

This is a way of representing integer values in code as words in a list. The first option in the list has the value 0, the second has the value 1, the third has the value 2 etc.

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

What is a struct?

A

This is a new type of data structs that you define. The struct must contain multiple data types.

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

How do you define a struct?

A

struct Name {
int variable_1;
int variable_2;
};

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