For All Human Beings.......

Saturday, April 26, 2008

typedef

USER DEFINED DATA TYPES : typedef


We have already seen a data type that is defined by the user (programmer): The structures. But in addition to these there are other kinds of user defined data types:

Definition of own types (typedef)

C++ allows us to define our own types based on other existing data types. In order

to do that we shall use keyword typedef, whose form is:

typedef existing_type new_type_name ;

where existing_type is a C++ fundamental or any other defined type and new_type_name is the name that the new type we are going to define will receive. For example:

typedef char C;
typedef unsigned int WORD;
typedef char * string_t;

Click here for detailed notes.........


No comments: