1.

Which of the following is a properly defined structure?(a) struct {int a;}(b) struct a_struct {int a;}(c) struct a_struct int a;(d) struct a_struct {int a;};The question was asked by my college director while I was bunking the class.The doubt is from Structures in portion Types, Pointers, Arrays & Structures in C++ of C++

Answer»

Correct OPTION is (d) struct a_struct {int a;};

Explanation: option struct {int a;} is not correct because NAME of structure and ;(after DECLARATION) are MISSING. In option struct a_struct {int a;} ; is missing. In option struct a_struct int a; {} are missing.



Discussion

No Comment Found

Related InterviewSolutions