c / beginner
Snippet
Type Aliasing with typedef
The typedef keyword creates a new name for an existing data type, making the code more descriptive and readable.
snippet.c
1
2
typedef unsigned int Age;Age userAge = 25;
Breakdown
1
typedef unsigned int Age;
Defines 'Age' as an alias for the type 'unsigned int'.
2
Age userAge = 25;
Declares a variable using the newly created type alias.