QUESTION 45 · C fundamentals
Distinguish declaration from initialisation with an example.
2 marksAnswer
A declaration introduces an object and its type; initialisation supplies its starting value.
- int count; declares count without supplying an initial value.
- int count = 0; declares and initialises count. An automatic local object needs a valid value before it is read.