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
Where are c variables stored in memory?
What are the advantages of union?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
how to write a c program to print list of fruits in alpabetical order?
Is swift based on c?
What is a file descriptor in c?
What is time null in c?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
What are header files and what are its uses in C programming?
What is wrong with this code?
What is null pointer in c?
How can you find the day of the week given the date?
Hai what is the different types of versions and their differences
Compare array data type to pointer data type
Can you return null in c?