structures are user defined data types. We can store multiple variables of any data type in one place .each variables within the structure is called structure member. They can hold any number of variables. The general syntax of declaring structure is given below
in the above syntax,name refers to the name of the structure,i.e; the name of the new data type. Struct variables are the names of structures variables observe the following example
accessing the members of a structure:
individual structure members can be accessed by dot operator(.) between structure name and variable name.
for assigning first values we use
for assigning second values we use
we can assign values to the structures just as initiating arrays. The structure declaration is followed by an equal sign and alist of initialization values is separated by commas and enclosed in braces.
lets see one example