Pragma is implementation specific directive i.e each pragma directive has different implementation rule and use . There are many type of pragma directive and varies from one compiler to another compiler .If compiler does not recognize particular pragma the it simply ignore that pragma statement without showing any error or warning message and execute the whole program assuming this pragma statement is not present. For example suppose there is any pragma directive is #pragma world .
#include<stdio.h>
#pragma world
int main(){
printf("C is powerful language ");
return 0;
}
Output : C is powerful language
Explanation:
Since #pragma world is unknown for Turbo c 3.0 compiler so it will ignore this directive without showing any error or warning message and execute the whole program assuming #pragma world statement is not present.
List of pragma directives in turbo c 3.0:
1. #pragma startup
2. #pragma exit
3. #pragma warn
4. #pragma option
5. #pragma inline
6. #pragma argsused
7. #pragma hdrfile
8. #pragma hdrstop
9. #pragma saveregs
- Preprocessor definitions in c
- Preprocessor directive in c
- #include directive in c
- # define directive in c
- Pragma directive in c
- #pragma startup and #pragma exit
- #pragma inline direcive
- Warning directive
- Preprocessor operators in c
- # if directive in c
- #line directive in c
- # error directive in c
- # elif in c
- # ifdef and #endif in c
- # ifndef in c example
- #undef in c
- What is header file in ?
- C preprocessor questions
- C tutorial home.
4 comments:
can you descibe each after 3rd???
what is the use of this
Post a Comment