Sunday, March 16.

Header Ads

Colorful+Black+Friday+Discount+Leaderboard+Ad

Directives

Muscle+Inc.+%25282%2529

Directives

Directives

Preprocessors कई Features प्रदान करता है जिसे Directives कहते हैं | Preprocessor Directives को लिखने का तरीका “C” के Statements लिखने के तरीके से अलग होता है | हर Preprocessor Directive #sign से शुरू होता है और Preprocessor Statement के बाद Semicolon का प्रयोग नहीं किया होता है |

हमने इन Directives का प्रयोग #define #include के रूप में पिछले Programs में किया है | इन Directives को Program में कहीं भी Place किया जा सकता है , लेकिन सामान्यतया इन्हें किसी भी Function Definition के पहले लिखते हैं चाहे वह main() Function ही क्यों ना हो | सामान्यतया Preprocessors को Macro भी कहते हैं | हम निम्न Directives को सर्वाधिक उपयोग में लेते हैं |

 

Directive          Function

#define         Defines a Macro Substitution

#undef          Undefines a Macro 

#include        Includes a file in the source program

#ifdef            Tests for a Macro Definition

#endif           Specifies the end of #if

#ifndef          Checks whether a Macro is defined or not

#if                 Checks a compile Time condition

#else             Specifies alternatives when #if Test Fails


 

No comments

Post Top Ad

Post Bottom Ad