what is the use of #pragma pack, wer it is used?
Answer Posted / ram
actually pragma pack is used for structure padding
we are having #pragma pack 0,#pragma pack 1,#pragma pack
2,#pragma pack 3,#pragma pack 4
in this first one will allocate memory 4 bytes for every
data type
in second one i.e in pack 1 it allocates 1 byte for every
data type
in third one i.e in pack 2 it allocates 2 bytes for every
data type
in fourth one i.e pack 3 it allocates 3 bytes for every data
type
in fifth one i.e pack 4 it allocates 4 bytes for every data type
Actually pragma will be used in powers of 2 only
| Is This Answer Correct ? | 3 Yes | 10 No |
Post New Answer View All Answers
What is a lookup table in c?
Which header file is essential for using strcmp function?
Describe the order of precedence with regards to operators in C.
how many errors in c explain deply
Can we declare a function inside a function in c?
In c programming language, how many parameters can be passed to a function ?
What is a #include preprocessor?
Do you have any idea about the use of "auto" keyword?
What are structural members?
What are the rules for identifiers in c?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What are linked lists in c?
Do you know the use of 'auto' keyword?
Why does the call char scanf work?
Write a program in c to replace any vowel in a string with z?