InterviewSolution
Saved Bookmarks
| 1. |
What is structure? Declare a structure in C++ with name ,roll number and total marks as component. |
|
Answer» ong>ANSWER: A structure is a collection of variables referenced under one name. A structure is declared using the keyword struct as in following syntax: struct { [public:] | [private:] | [protected:] /* data members’ declarations */ /* MEMBER functios’ declarations */ }; Example: struct STUDENT { char Name[30]; int Rollno; float Total_Marks; };Read more on Sarthaks.com - https://www.sarthaks.com/434990/what-is-structure-declare-structure-in-with-name-roll-number-and-total-marks-as-components |
|