What is the use of typedef?

What is the use of typedef?

The keyword typedef is used for defining user defined data types. A new definition of existing data types is created by using typedef. It is used to define user defined identifiers which can be used in substitution of type specifiers such as int, float etc. It does not reserve memory space. The names defined by typedef are synonyms for the data types.

For example typedef int integer;

Instead of int the new definition integer can be used for better readability.
Can we specify variable field width in a scanf() format string?
It is possible to specify variable field width in a scanf() format string....
Out of fgets() and gets() which function is safe to use and why?
The function fgets() function is safer to use. It checks the bounds, i.e., the size of the buffer and does not cause overflow on the stack to occur......
Difference between strdup() and strcpy()
The function strcpy() will not allocate the memory space to copy. A pointer to the string to copy and a pointer to place to copy it to should be given.....
Post your comment