Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the use of #pragma pack, wer it is used?

Answers were Sorted based on User's Feedback



what is the use of #pragma pack, wer it is used?..

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

what is the use of #pragma pack, wer it is used?..

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

Post New Answer

More C Interview Questions

regarding pointers concept

0 Answers  


How can I send mail from within a c program?

0 Answers  


while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.

1 Answers   TCS,


What are the advantages and disadvantages of pointers?

0 Answers  


What are local static variables? How can you use them?

0 Answers  


How to access or modify the const variable in c ?

16 Answers   HCL, HP,


What is meant by 'bit masking'?

0 Answers  


what is the output of the program?? #include<stdio.h> main ( ) { int a=010,sum=0,tracker: for(tracker=0;tracker<=a;tracker++) sum+=tracker; printf(ā€œ %d\nā€,sum); } what is the difference between a=10 and a=010??

3 Answers   Oracle,


string reverse using recursion

0 Answers   Mind Tree,


say the following declaration is correct nr not. int b=a,n=0;

4 Answers   Wipro,


ABCDCBA ABC CBA AB BA A A

4 Answers   TCS,


main() { int i = 10; printf(" %d %d %d \n", ++i, i++, ++i); }

10 Answers   TCS, Vector,


Categories