C Programming Reference >> C Basic Tutorials >> C Keywords Home >> structui 30/12/06 - Views - Ratings : Its used to declare user defined aggregated varaibles known as structure. Each member of structure is defined in code block following the keyword . Name of the structure comes in between the struct keyword and the opening curly bracket. Name of the objects follows the closing curly bracket. Either name or object are optional but not both. Code - struct my
{
int a;
float b;
}o1;
void function (void)
{
struct my o2;
o2.a = 10;
o1 = o2 ;
printf ("%d %d", o1.a ,o2.a);
}
|