Variables Flashcards
What is initialisation?
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;
What is the constructor method?
This is where you declare a variable and then assign it a value later.
What is the issue with not initialising a variable immedietly?
The variable gets given a random value
What does Enum stand for?
This is an Enumerated type
What is an Enum?
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.
What is a struct?
This is a new type of data structs that you define. The struct must contain multiple data types.
How do you define a struct?
struct Name {
int variable_1;
int variable_2;
};