1.

Which among the following is true for the variables?(a) Variable can be defined only once(b) Variable can be defined any number of times(c) Variable must be defined more than one time(d) Variable can be defined in different filesI had been asked this question during an interview for a job.I need to ask this question from Extern Variable in chapter Memory Allocation & Scope of Variable of Object Oriented Programming

Answer»

Correct answer is (a) Variable can be defined only once

The best explanation: The variables can be defined only once. Once the variable is defined, then it can’t be DECLARED again. The DEFINITION of a variable is ACTUAL allocation of MEMORY for the variable.



Discussion

No Comment Found

Related InterviewSolutions