1.

Which of the following statement is correct?(a) Structure in C allows Constructor definition(b) Structure in C++ allows Constructor definition(c) Both allow Constructor definition(d) C allows constructor definition while C++ does notI had been asked this question in quiz.Query is from C++ Concepts in portion Basics Concepts of C++ of C++

Answer»

Right option is (b) Structure in C++ ALLOWS Constructor DEFINITION

To explain I would SAY: As C does not allow the programmer to define a function INSIDE a structure and constructor itself is a function, therefore, the constructor definition is not ALLOWED in C whereas such definitions are allowed in C++.



Discussion

No Comment Found

Related InterviewSolutions