structure is a user defined data types it is a collection of heterogenous elements (Data).
by default all members of structure are public structure contain only data members .
Referencing (calling ) structure elements -
once a structure variable has defined its members can be occured through the use of dot opreator
example :
birth _date .year -1740
the structure variable name followed by period (.)and element name reference that indivisual structure element .
SYNTAX:
structure _ name element_name
structure assignment is possible only if both structures are of same structure .
Nested Structure:- A structure element can be complex or simple. The simple element are only of the fundamental data type of C++ i.e.; int , char, float, double,. A structure consisiting of complex elements is called a complex structure. The nested structure are thus known as structure with a structure.
No comments:
Post a Comment