answersLogoWhite

0


Best Answer

The main difference is in how the data structures are stored. In a union, all of the elements are stored in one location. A structure stores each of its elements in a separate memory location.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

The difference between 'struct' and 'union' has absolutely nothing to do with file-management.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between struct and union in c file management?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Similarities between struct and union?

Struct and Union have following similarities:- Both are aggregated data types that allow a mixed for values to be contained in their instances.They are the way aggregation is done in C for making. The difference between them is that union allows the different items to be in it but allows access to be on one becase they are represented in overlapped manner. A Struct is also aggregation but it separates each data item contained in it and therefore anyone can be accessed anytime from its instance variable.Unions are ordinarily used because of performance and generalization ,while the structures are generally used for aggregation. For queries Rupesh Kumar Joshi ,rupesh_joshi@sify.com


Difference between central government and union government?

There is no difference between central and union government


Difference between array and union?

All the members of the structure can be accessed at once,where as in an union only one member can be used at a time. Another important difference is in the size allocated to a structure and an union. for eg: struct example { int integer; float floating_numbers; } the size allocated here is sizeof(int)+sizeof(float); where as in an union union example { int integer; float floating_numbers; } size allocated is the size of the highest member. so size is=sizeof(float);


What are the conflict between the management and the union?

The conflict between the management and the union are basically depend upon two factors . They are 1. Upward to downward communication and , 2. Downward to upward communication...this two are the main rigid factors which the management as well as the unions have to face.


Sentence with word union?

Our contract is now in negotiation between management and the union. I am proud to witness the union of my son and Ms. Porter on their wedding day. The American Civil war was between the Union and the Confederacy


What is the Difference of anti union policy between union avoidance?

The difference is that you are not putting down the union, you are uplifting the company. You are talking about the positive benefits or the organization vs. the negative benefit of a union.


Do Americans know the difference between Rugby league and Rugby Union?

In general those that follow union or league know the difference.


What was the difference between the Confederacy and the Union?

the union has more factories and bigger population than the confederacy.


What is the difference between a national union and a local union?

the local union is just a little union which is local and the national union is a union all over the nation/world.


Is a struct or a union more preferable in C programming?

They both do entirely different things so the preferred option is the one that fulfils your needs. A struct is used to combine two or more data types (members) into a single entity, where each member is stored and accessed separately within a contiguous block of memory. The size of a struct is equal to the total size of all its members, plus any padding for alignment purposes. A struct is not unlike a database record with two or more fields. However, to conserve memory and minimise padding, members must be declared in order of size, from largest to smallest. A union is used to store a single data type that can be re-interpreted, not unlike a static cast. The largest member determines the overall size of the union and the individual members determine how the memory is to be interpreted. Since all members effectively refer to the same memory address, only one member of a union may be accessed at any one time. Changing the value of any one member affects all members. Structs and unions can be combined both ways, so a struct may contain a union (allowing the same struct member to be re-interpreted) and a union may contain a struct. The latter form makes it possible for a union to contain a primitive data type, such as a 32-bit integer, as well as a struct member that contains two or more members that have a combined size of 32-bits, such as four separate 8-bit members (bytes). Changing the value of any one byte in the struct affects a different byte within the 32-bit integer because both the integer and the struct are mapped to the same address space.


What were difference between the North and the south?

North was Union, and South was Confederates.


What is the difference between a Confederate bullet and an Union bullet?

There was no difference between Confederate bullets and Union bullets. Both the Union and Confederate troops used any weapons and bullets that they could find. Weapons and bullets were frequently stolen from the other side.