You are on page 1of 1

What is use of structure and union? Structure is a user defined data type,that is collection of hetrogeneous data types.

if we have to assign memory to a record.for eg,book record,we can declare it as struct book { char name[20 ! int pages! fload price! "! struct book s#,s2! in last line we have declared two variable of struct type,now the basic data types variables will be recogni$ed in the form of structure. and the memory allocated to above structure will be char%#&20'(int%2'( float%)'* 2+ bytes. Union is same as structure,e,cept the difference that the memory allocated will be the highest data type memory,as in this case 20 bytes.because char type data name is taking highest memory,and this memory will be shared among all variables declared in the union. what are the disadvantages of using Pointers when we are using pointers the main disadvantages is that,the hacker can easily to identified address of the source code and change source code. -nother one is that to distributing of data base is difficult when it is in the server.

You might also like