![]() |
In C, typedef is used to give an existing type an alias or a new name. In this article, we will learn how to create a typedef for a union in C. Use the typedef union in CWe can define a union and create an alias for it using the SyntaxFor defining the union and creating a typedef simultaneously use: typedef union UnionName { For defining the union first, then creating a typedef use: union UnionName { C Program to Create an Alias Using typedef for a unionThe below program demonstrates the use typedef keyword to create a typedef for a union in C. C
Output
Integer value: 1084521025 Floating-point value: 5.14 Character value: A |
Reffered: https://www.geeksforgeeks.org
C Language |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 13 |