• Using typedef with structure, programmer can define new data type names for structure.
• The syntax for typedef with structure is very much similar to typedef with other types.
• It can be made more clearly using following example.
• In the following definition, p is an array of 10 records, which has the same structure as the person.
typedef struct
{
char name[10];
int height, weight;
}person;
Person p[10];
• The syntax for typedef with structure is very much similar to typedef with other types.
• It can be made more clearly using following example.
• In the following definition, p is an array of 10 records, which has the same structure as the person.
typedef struct
{
char name[10];
int height, weight;
}person;
Person p[10];
No comments:
Post a Comment