typedef

Advantages of typedef in a program:

There are three main reasons for using typedef:

1.It helps writing of complecated declarations a lot easier.This helps in eliminating a lot of clutter in the program.

2.It helps in achieving probability in programs.That is,if we use typedefs for data types that are machine-dependent,only the typedefs need change when the program is moved to a new machine platform.

3.It helps in providing a better documentation for a program.For example,a node of a doubly linked list is better understood as ptrtolist rather than just a pointer to a complicated structure.

Posted on by