Structure take individual memory space for each
variable while union takes largest memory space & all variable share its.
Example of Structure
|
struct emp
{
int code;
char name[20];
float sal;
};
intà2bytes
stringà20bytes
floatà4bytes
Total Memory occupiedà26bytes
union emp
{
int code;
char name[20];
float sal;
};
Total Memory occupied à20bytes
|
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
Thursday, December 25, 2014
DIFFERENCE BETWEEN STRUCTURE & UNION
Subscribe to:
Post Comments (Atom)
-
1) Workbook - A workbook is like a book and consists worksheets. 2) Worksheet - A worksheet is working area consists rows and columns. By...
-
Programmingway: SSC ICT PAPER PATTERN : INFORMATION COMMUNICATION TECHNOLOGY (41) (E) (NEW COURSE) NOTE: - (i) All questions are compu...
-
Choose Eklavya, for Computer Education वाह रे जिंदगी, एक साल में बहुत कुछ दिखाया है तूने..!!
No comments:
Post a Comment