what is the use of #pragma pack, wer it is used?
Answers were Sorted based on User's Feedback
Answer / sarabjit kaur
#pragma is a miscelleneous directive which is used to turn
on or off certain features.
It varies frm compiler to compiler
a. #pragma startup and #pragma exit
used to specify which function should b called upon startup
(before main()) or program exit(just before program
terminates)
such funtions should nt receive or return any valur
b. #pragma -warn used to surpress specific warning
#pragma warn -rvl return value warnings surpressed
#pragma warn -par parameter not used warnings surpressed
#pragma warn -rch unreachable code warnings surpressed
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / 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 |
Why we use break in c?
2. What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Is array a primitive data type in c?
totally how much header files r in c language
Explain what are multidimensional arrays?
How can I increase the allowable number of simultaneously open files?
for questions 14,15,16,17 use the following alternatives:a.int b.char.c.string.d.float
IS STRUCTURES CAN BE USED WITHIN AN ARRAY?
a=0; b=(a=0)?2:3; a) What will be the value of b? why b) If in 1st stmt a=0 is replaced by -1, b=? c) If in second stmt a=0 is replaced by -1, b=?
What is #error and use of it?
Can a pointer point to null?