Why we use "Type Def" in C ?
-
Modifying existing Data type.
-
Used for defining type of data type used.
-
Creating new data type names
-
Not a valid key word
typedef creates an alias or new name for an existing data type, making code more readable and easier to maintain. For example, typedef unsigned int UINT; allows you to use UINT instead of unsigned int throughout your program. It does not modify the data type itself, just provides an alternative name for it.
The typedef keyword in C is used to give an existing data type a new, alternative name (an alias) — for example, typedef unsigned int uint; creates uint as another name for unsigned int. It does not modify or change the underlying data type in any way; it simply lets programmers refer to existing types under new, often more descriptive or convenient, names.