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
Can main () be called recursively?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
How can I discover how many arguments a function was actually called with?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
Explain Basic concepts of C language?
How do you define a function?
Can the size of an array be declared at runtime?
Explain Function Pointer?
How to find a missed value, if you want to store 100 values in a 99 sized array?
Explain how can I prevent another program from modifying part of a file that I am modifying?
Write a client and server program in C language using UDP, where client program interact with the Server as given below: i) The client begins by sending a request to send a string of 8 characters or series of 7 numbers, the server sends back a characters or numbers as per the request of the client. ii) In case of series of 7 numbers: The client sends a multiplication of numbers, to the server. iii) In case of a string of 8 characters: The client sends a reverse order of string to the server.. iv) Server will send an acknowledgment to the client after receiving the correct answer
How does struct work in c?
What is adt in c programming?
What is difference between scanf and gets?