Coding - Practical 6 Flashcards
1
Q
What is the code to print the address of a variable (e.g. wave)?
A
std::cout «_space;“Address of variable : “ «_space;&wave «_space;“\n”;
2
Q
What symbol is used to get the address of the variable?
A
&
3
Q
What are shared variables?
A
Shared variables are variables that can be accessed between functions. Shared variables also retain their value while the program continues to run.
4
Q
What is an address?
A
An address is where a variable lives (in memory) - each variable has its own address.