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 nested structure in c?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Is calloc better than malloc?
Describe the order of precedence with regards to operators in C.
What are reserved words?
What are the different types of endless loops?
What are the 5 types of organizational structures?
What is a stream?
What are the types of type qualifiers in c?
What does %d do in c?
What is use of null pointer in c?
What are the functions to open and close the file in c language?
What are the keywords in c?
What is an expression?
What are logical errors and how does it differ from syntax errors?