Differentiate structures unions separately? |
[Edit] |
Answer
Structures - A tool for handling a group of logically related data. For example::
struct book
{
char bookname
char authorname
int no_of_pages
}
This is a example of structure coz it is logically related to the object books but at the same time, it has diff data types - char int.
UNION:: It is juz a concept borrowed from structures. Diff between structure & union is storage. In structure, each member has its own storage location whereas all the members of a union use the same location. Union can handle only one member at a time, coz only one location is allocated for a union, var irrespective of size
First answer by ID995903066. Last edit by ID995903066. Question popularity: 9 [recommend question]
|
Research your answer: |



