Question:
What is a pragma?
Answer:
The #pragma preprocessor directive allows each compiler to implement compiler-specific features that can be turned on and off with the #pragma statement. For instance, your compiler might support a feature called loop optimization. This feature can be invoked as a command-line option or as a #pragma directive.
To implement this option using the #pragma directive, you would put the following line into your code:
#pragma loop_opt(on)
Conversely, you can turn off loop optimization by inserting the following line into your code:
#pragma loop_opt(off) Source: CoolInterview.com
ya we can use better way #pragma pre processor In case of structure memory is padding while declaring of structure to over come this problem better way.... we write our code as follows #pragma pack(push) #pragma pack(1) place this before structure we can aviod padding in structure Source: CoolInterview.com
Answered by: kumar | Date: 4/28/2009
| Contact kumar
the pragma is define a set of programm Source: CoolInterview.com
Answered by: chandan | Date: 12/13/2009
| Contact chandan
Program is set of instruction. After execution of program the instruction is followed by the machine or PC. Source: CoolInterview.com
Answered by: Rahul Sapkal | Date: 3/23/2010
| Contact Rahul Sapkal
The #pragma preprocessor directive.use full for turn on and turn of features of compiler . Source: CoolInterview.com
Answered by: bhargav | Date: 4/19/2010
| Contact bhargav
A set of program is called pragma Source: CoolInterview.com
Answered by: Vivek | Date: 5/23/2010
| Contact Vivek
pragma is a collection of programs which is mainly used for turning on or off features of compiler Source: CoolInterview.com
Answered by: akhilesh | Date: 7/3/2010
| Contact akhilesh
pragma is a preprocessor directive using which we can combine the application of the C language along with assembly language for changes that could be made to hardware such as microprocessors, microcontrollers etc. Comments invited. Source: CoolInterview.com
Answered by: GANESH KAMATH | Date: 7/3/2010
| Contact GANESH KAMATH
#pragma is a pre processor directive. This tells us which function do we start our execution of the program usinf #pragma startup<function-name> and which funtion should the execution end using the #pragma exit<function-name>. Source: CoolInterview.com
Answered by: SONAL G KALRA | Date: 7/12/2010
| Contact SONAL G KALRA
this is an implementation define directive that allows various instruction tobe given to the compiler its syntax #pragma name Source: CoolInterview.com
Answered by: sushil kumar maurya | Date: 7/25/2010
| Contact sushil kumar maurya
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|