Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is infinite loop?

1076


How do I create a directory? How do I remove a directory (and its contents)?

1155


What is the return type of sizeof?

1059


What do you understand by friend-functions? How are they used?

1195


How do you determine whether to use a stream function or a low-level function?

1113


What is formal argument?

1123


Difference between strcpy() and memcpy() function?

1124


What does *p++ do?

1012


Can you apply link and association interchangeably?

1115


Can we change the value of #define in c?

986


What is pass by reference in functions?

832


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

1931


What is a rvalue?

1190


write a program to concatenation the string using switch case?

2085


What is the use of extern in c?

1083