1.

What is the scope of the variable declared in the user defined function?(a) whole program(b) only inside the {} block(c) the main function(d) header sectionI had been asked this question in an international level competition.This intriguing question originated from Function Declarations in portion Functions, Namespaces & Exceptions in C++ of C++

Answer»

Correct answer is (b) only inside the {} block

To explain: The VARIABLE is VALID only in the FUNCTION block as in other.



Discussion

No Comment Found

Related InterviewSolutions