C allows you to define your own types, and this can make your codes much more legible.
For example, you can define a type called price that you can use to define variables that
you use to represent the price of certain objects. To do so, you would use

typedef float price;
int main(void) {
price x, y;
}

The typedef is used in the following way:
typedef existing_type new_type;
The price type example is identical to using
float x, y;

but it is useful to use typedef when you would like the ability to change the types of certain
variables throughout your codes by only changing one line. That is, if you wanted to change
all of your prices to type double, then you would only need to change the typedef line to
typedef double price;
Designed By Blogger Templates | Templatelib & Distributed By Blogspot Templates