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
Explain the use of #pragma exit?
What is unary operator?
What are structural members?
write a program to rearrange the array such way that all even elements should come first and next come odd
Write a code to generate divisors of an integer?
Difference between constant pointer and pointer to a constant.
Tell us bitwise shift operators?
What standard functions are available to manipulate strings?
Is c object oriented?
Who developed c language and when?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
Compare interpreters and compilers.
How #define works?
What is indirection?