How to avoid structure padding in C?
Answer Posted / santosh
Packing, on the other hand prevents compiler from doing padding - this has to be explicitly requested - under GCC it's __attribute__((__packed__)), so the following:
struct __attribute__((__packed__)) mystruct_A {
char a;
int b;
char c;
};
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
write a proram to reverse the string using switch case?
Define the scope of static variables.
What is the function of volatile in c language?
what is recursion in C
What is an lvalue?
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
When should a type cast not be used?
How main function is called in c?
What is a void pointer? When is a void pointer used?
What is a pointer variable in c language?
What should malloc() do?
What is data structure in c programming?
What are the types of operators in c?
Write a function that will take in a phone number and output all possible alphabetical combinations
What is switch in c?