Sunday, February 5, 2012

What are the #pragma statements ?

Each implementation of C and C++ supports some features unique to its host machine or operating system. Some programs, for instance , need to exercise precise control over the memory areas where data may be stored or to control the way certain functions receive parameters.

The #pragma directives offer away for each compiler to offer machine and operating system-specific features while retaining overall compatibility with the C and C++ languages. Pragmas are machine or operating system-specific by definition, and are usually different for every compiler.

Pragmas can be used in conditional ststements , to provide new preprocessor functionality, or to provide implementation-defined information to the compiler.

The `#pragma' directive is the method specified by the C standard for providing additional information to the compiler, beyond what is conveyed in the language itself. Three forms of this directive (commonly known as pragmas) are specified by the 1999 C standard. A C compiler is free to attach any meaning it likes to other pragmas.

No comments:

Post a Comment