Question:

What is #pragma in c? can anyone explain

by  |  earlier

0 LIKES UnLike

what is #pragma in c? can anyone explain

 Tags:

   Report

2 ANSWERS


  1. It's a compiler specific preprocessor directive:

    http://xoax.net/comp/cpp/reference/prepr...

    The actual meaning depends on the argument used with the pragma.


  2. It's a way of accessing compiler-specific features.  For example, some compilers allow you to change the padding used in structures with something like:

    #pragma pack(2)

    The only standard pragma is "error", which is a way to display a message and have the compiler generate an error.

    #pragma error "text to display"

    Any other pragma would be documented by your compiler's manufacturer somewhere in the documentation.

    - kb -

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.