1. Structure
Structures are user defined data types
It is a collection of heterogeneous data
It can have integer, float, double or character data in
it
We can also have array of structures
struct <<structname>>
{
members;
}element;
We can access element.members;
3. typedef statement
User Defined Data Types
The C language provides a facility called typedef for
creating synonyms for previously defined data type names.
For example, the declaration:
typedef int Length;
makes the name Length a synonym (or alias) for the data
type int.
4. typedef(contd.)
The data “type” name Length can now be used in
declarations in exactly the same way that the
data type int can be used:
Length a, b, len ;
Length numbers[10] ;
6. UNION
Union has members of different data types, but can
hold data of only one member at a time.
The different members share the same memory
location.
The total memory allocated to the union is equal to
the maximum size of the member.
10. Enumerated(contd.)
As an example, the statement:
enum colors { red, yellow, green } ;
creates three constants.
red is assigned the value 0,
yellow is assigned 1 and
green is assigned 2.