What is the difference between struct and union in C?
A struct is a block of memory that stores several data objects, where those objects don't overlap. A union is a block of memory that stores several data objects, but has only storage for the largest of these, and thus can only store one of the data objects at any one time.
| Is This Answer Correct ? | 0 Yes | 0 No |
what would be the output of the follwing struct st { char name[20]; int i; float f; }; main() { struct st emp = {"forum"}; printf("%d %f",emp.i,emp.f); }
What are the types of c language?
What is pre-emptive data structure and explain it with example?
How can I remove the leading spaces from a string?
What are the 5 data types?
what is the significance of static storage class specifier?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is difference between structure and union with example?
What does typeof return in c?
2.main { int x,j,k; j=k=6;x=2; x=j*k; printf("%d", x);
Can the “if” function be used in comparing strings?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
5 Answers TCS, Vimukti Technologies,