ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
What is #pragma directive?how it is used in the program?
what is its advantages and disadvantages?
 Question Submitted By :: Babitha.b
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?
Answer
# 1
See may help you some how....Answer with more clarity will
be appreciable.....

#pragma .... are documented in the GCC manual as follows.

#pragma GCC dependency
    #pragma GCC dependency allows you to check the relative
dates of the current file and another file. If the other
file is more recent than the current file, a warning is
issued. This is useful if the current file is derived from
the other file, and should be regenerated. The other file is
searched for using the normal include search path. Optional
trailing text can be used to give more information in the
warning message.

              #pragma GCC dependency "parse.y"
              #pragma GCC dependency "/usr/include/time.h"
rerun fixincludes
         


#pragma GCC poison
    Sometimes, there is an identifier that you want to
remove completely from your program, and make sure that it
never creeps back in. To enforce this, you can poison the
identifier with this pragma. #pragma GCC poison is followed
by a list of identifiers to poison. If any of those
identifiers appears anywhere in the source after the
directive, it is a hard error. For example,

              #pragma GCC poison printf sprintf fprintf
              sprintf(some_string, "hello");
         

    will produce an error.

    If a poisoned identifier appears as part of the
expansion of a macro which was defined before the identifier
was poisoned, it will not cause an error. This lets you
poison an identifier without worrying about system headers
defining macros that use it.

    For example,

              #define strrchr rindex
              #pragma GCC poison rindex
              strrchr(some_string, 'h');
         

    will not produce an error.
#pragma GCC system_header
    This pragma takes no arguments. It causes the rest of
the code in the current file to be treated as if it came
from a system header
 
Is This Answer Correct ?    0 Yes 0 No
Gg
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.  1
What are the preprocessors? HP6
how to convert an char array to decimal array  3
what are the interview question's in the language c Nipuna1
char ch=10;printf("%d",ch);what is the output Accenture11
Write a program to exchange two variaables without temp Geometric-Software6
write a function to find whether a string is palindrome or not and how many palindrome this string contain?  1
program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.  3
Program to display given 3 integers in ascending order N-Tech1
write a program for even numbers?  8
could u able to tell about suresoft technical session  1
What is the difference between null pointer and void pointer CTS3
without a terminator how can we print a message in a printf () function. NIIT5
Write a C function to search a number in the given list of numbers. donot use printf and scanf Honeywell6
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
Here is alphabets : abcdefgh 1) how to reverse. as hgfedcba 2) after reversal, how to group them in a pair hg fe dc ba.  2
Whats wrong with the following function char *string() { char *text[20]; strcpy(text,"Hello world"); return text; } Qualcomm3
O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N ADP9
Main must be written as a.the first function in the program b.Second function in the program c.Last function in the program d.any where in the program TCS12
what is the maximum limit of row and column of a matrix in c programming. in linux .  1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com