Structures in C++ | struct in cpp
Structures in C++ What are structures in CPP? Structures are user-defined data types in CPP or you can say heterogeneous data types. As you know there are traditional (standard) data types in CPP for e.x. - int, char, float, etc. but structure is a container of one or more than one standard data type. For example, if we create a data type named " Student " then the " Student " data type may contain the " name " variable of char type, " roll_no " var of int type, " percentage " variable of float data type. You can protect your data members with three access specifier private - Data members & methods can access only in the class public - Data members & methods can access the program protected - Data members can access the child structure or clas But Remember, no function can be a part of either private or public specifier. Also, it is to be kept in mind there was a need for class, because of the concept of inheritance and func...