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)
Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi...
Programmingway@Eklavya Technosys!: JAC Board Computer Examination Sample Questions Hi... : 1) Which of the following is NOT a web service? (...
-
1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTPs - Hyper Text Transfer Protocol. 3) ICT - Information Comunication Te...
-
1) What is Make Code Arcade? Answer: Make Code Arcade is a coding platform that enables to create block – based program. 2) How ...
-
Marks Division HOE 30 Marks IT Application Report File 20 Marks Viva - Voce 10 Marks 1) Write an HTML code to generate a web p...
No comments:
Post a Comment