In C programming, "typedef" is a keyword that allows you to create an alias or synonym for an existing data type. This can make the code more readable and maintainable by giving a more meaningful name to a complex or obscure data type.
Syntax :
typedef data_type new_name ;
For example, you can use typedef to create an alias for the "int" data type, like this:
Example :
typedef int INTEGER ;
With this definition, you can use "INTEGER" in place of "int" throughout your code.
//typedef in C Programming #include<stdio.h> typedef struct student { char *name; int age; float per; } student; int main() { typedef int INTEGER; INTEGER a; student o; a=100; printf("\nA : %d",a); o.name="Tutor Joes"; o.age=30; o.per=85.5; printf("\nName : %s",o.name); printf("\nAge : %d",o.age); printf("\nPercent : %f",o.per); return 0; }To download raw file Click Here
A : 100 Name : Tutor Joes Age : 30 Percent : 85.500000
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions