What you mean by structure and union? (BCA- 2 semester)


 Definition Structure:-

user need to store large amount of data in a 'C' long it used Aryan working a group data and value but structure describe different type of elements structure is a user defined data type which consider other data type it provide facility to store data and manage properly.

Syntax of structure:-

strict  structure name

{

member elements

  int

 char

 float

 string

} structure tag;

example of structure:-

strict book- bank

{

char title[10];

int page[5];

float price;

};

Definition of Union:-

It is same as structure and have same Syntex, There is a major different between structure and union. In terms & storage data. In union all members variable allocate same memory in data structure.

Syntex of union:-

union union- name

 {

int

char

float

string

} union tag;

example of union:-

union book

{

int bcode;

float price;

}

No comments:

Post a Comment

If you have any doubts, Please lets me know and Please Follow our Website