EmbLogic's Blog

related c

difference b/w structure and union.

Structure:

1. It allocates memory equal to sum of memory allocated to its each individual member.

2.each member have their own memory space.

3. structure can not  be implemented in shred memory.

4. it has less Ambiguity.

5. Self referential structure can be implemented in data structure.

6. All members if structure can be accessed at a time.

Union:

1.It allocates piece of memory that is Large enough to hold the Largest variable of type in union.

2. one block is used by all the members of union.

3. Union is the Best environment where memory is shared.

4. as memory is shared, Ambiguity is more in union.

5. self ref. union can not be implemented.

6. only one member is accessed at a time.

One Response to related c

  1. spatlou says:

    Structure:

    1. It allocates memory equal to sum of memory allocated to its each individual member.

    2.each member have their own memory space.

    3. structure can not be implemented in shred memory.

    4. it has less Ambiguity.

    5. Self referential structure can be implemented in data structure.

    6. All members if structure can be accessed at a time.

    Union:

    1.It allocates piece of memory that is Large enough to hold the Largest variable of type in union.

    2. one block is used by all the members of union.

    3. Union is the Best environment where memory is shared.

    4. as memory is shared, Ambiguity is more in union.

    5. self ref. union can not be implemented.

    6. only one member is accessed at a time.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>