Advantages of _Generic
Following are some main advantages of _Generic in C:
- It can be used to stimulate function overloading when used with macros.
- Allows the functionality to execute the code based on the type of parameters.
_Generics Keyword in C
The _Generic keyword in C is used to implement a generic code that can execute statements based on the type of arguments provided. It can be implemented with C macros to imitate function overloading. The _Generic keyword was first introduced in C11 Standard.