DekGenius.com
Team LiB   Previous Section   Next Section
#pragma directive Controls the compiler

#pragma tokens

figs/acorn.gif

The #pragma directive is implementation-defined. An implementation can define certain pragma parameters to control the compiler. The preprocessor ignores any pragma that it does not recognize.

Because pragmas are highly compiler-dependent, you should avoid using them as much as possible. Most compilers let you control the compiler by providing command-line options, configuration files, or project files. Do your best to keep compiler-specific information out of your source files. When you must use pragmas, protect them with conditional directives for specific compilers.

Example

#ifdef _  _BORLANDC_  _
  #pragma pack
#endif
#ifdef _  _COMO_  _
  #pragma instantiate
#endif
    Team LiB   Previous Section   Next Section