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
There is no such thing. Structs and unions have fields, which can be accessed by their names.
Protection from the greed and evil of the company. Answer #2: Given that memory is no more at premium, I really do not see any practical reason to prefer unions over structures.
Structures and unions share the following characteristics: * Their members can be objects of any type, including other structures and unions or arrays. A member can also consist of a bit field. * The only operators valid for use with entire structures and unions are the simple assignment (=) and sizeof operators. In particular, structures and unions cannot appear as operands of the equality ( == ), inequality (!=), or cast operators. The two structures or unions in the assignment must have the same members and member types. * A structure or a union can be passed by value to functions and returned by value by functions. The argument must have the same type as the function parameter. A structure or union is passed by value just like a scalar variable; that is, the entire structure or union is copied into the corresponding parameter. similarity is all three are user defined data types.
They can be compared with memcmp, but you should be careful if your structures contain:- pointers- alignment gaps- numeric variables (byte order!)- nested structures/unions
craft unions and industrial unions
There are four different types of credit unions. They are global credit unions, national credit unions, local credit unions, and employee credit unions.
Craft or Occupaton Unions, Industrial and General Unions
Labor Unions
Craft unions and industrial unions were two types of unions formed by American workers.
unions were buttholes
unions were buttholes
Unions are considered labor interests groups. They exists to give employees a voice in their working relationship with their employer.