C Programming Reference


C Programming Reference >> C Basic Tutorials >> C Keywords Home >>

structui

30/12/06 -  Views - Ratings :   3.48 of 5 / 155 Votes

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);  
}

Back To Top


      

 

 

© 2006 cencyclopedia.com