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

Explain a file operation in C with an example.

1118


Describe the steps to insert data into a singly linked list.

1068


What is the general form of function in c?

1020


what is uses of .net

1728


What is identifiers in c with examples?

1169


The __________ attribute is used to announce variables based on definitions of columns in a table?

1198


What is the purpose of main() function?

1243


why return type of main is not necessary in linux

2104


Here is a good puzzle: how do you write a program which produces its own source code as output?

1091


What is sizeof array?

1054


What are file streams?

1010


Explain what are the different data types in c?

1213


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1065


What is a c token and types of c tokens?

1057


What is masking?

1151