What is structure in C++?
- The C++ programming technique allows defining user defined datatypes through the structure.
- It is used to represent a record.
- The 'struct' keyword is used for declaring a structure.Syntax:
//declaration of structure member;
- Structure always ends with a semicolon ( ; ).
- Accessing any member of a structure, we use the method access operator ( . ).Example:
student s1; //Declaring object of type student
cout<<"Student Name :"<<s1.name;
cout<<"Student Address :"<<s1.address;