How to avoid structure padding in C?

Answer Posted / akshay singh

i think for avoid structure padding you use only the #pragma pack(1) its sufficient for structure padding
i am not sure about windows application this concept i used in linux or unix

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is clrscr in c?

657


How can I write functions that take a variable number of arguments?

614


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1823


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

647


What is sorting in c plus plus?

556






How do I use void main?

617


What is a class c rental property?

593


Explain about the functions strcat() and strcmp()?

587


What does #pragma once mean?

673


main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none

708


Can the “if” function be used in comparing strings?

576


What is hungarian notation? Is it worthwhile?

679


What is unary operator?

644


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1200


can we implement multi-threads in c.

648