C | Variable Declaration and Scope | Question 4
var = 0;
var = 10;
(B) Compiler Error: var is not defined
Explanation: If a variable is only declared and an initializer is also provided with that declaration, then the memory for that variable will be allocated i.e. that variable will be considered as defined.
Refer: Understanding “extern” keyword in C
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important C++ Foundation and STL concepts with the C++ Foundation and STL courses at a student-friendly price and become industry ready.