Results 1 to 4 of 4

Thread: How can I use the pragma directive in C?

  1. #1
    Join Date
    Jan 2010
    Posts
    29

    How can I use the pragma directive in C?

    Hello, Everyone. I am MCA student of first year. I have the C programming in syllabus of first year. I know C is the base of all programming languages. but I don't have the good knowledge of the C programming. So I just want to know about the #pragma directives in C. I also want to know how can use it in the program. Which are they? So if anyone know about the pragma directive then help me out as soon as possible.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    #pragma

    Hi, I guess at least you heard about the #pragma directive. Pragma is nothing but the implementation of specific directive that means each pragma directive has the different implementation rule and use. There are many type of different pragma directive and they varies from one compiler to another compiler . If compiler does not recognizes the particular pragma then it ignores the pragma statement without showing any error or warning message and execute the whole program assuming that this pragma statement is not present.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Directives in C

    The #pragma directive is the method that is specified by the standards of C to give some additional information to the C compiler, that what is specified in the C language itself. A C compiler is free to attach any meaning it likes to other pragmas. For example Suppose any arbitrary pragma directive is #pragma world:
    #pragma world
    void main()
    {
    printf(“ C is the powerful language “);
    }
    Output: C is the powerful language
    Last edited by Katty; 21-01-2010 at 08:34 AM.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    List of pragma

    I suggest you to use the one the following pragma directive.
    List of pragma directive:
    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
    I hope it will helps you to understand about the pragma directive.

Similar Threads

  1. what is the use of iostream directive?
    By Diellza in forum Software Development
    Replies: 4
    Last Post: 08-01-2011, 12:46 AM
  2. A fatal error or timeout occurred while processing this directive
    By Xan Mathew in forum Networking & Security
    Replies: 5
    Last Post: 18-06-2010, 05:47 PM
  3. How to Use the #include Directive in ASP?
    By NIcaBoy in forum Software Development
    Replies: 5
    Last Post: 02-02-2010, 06:24 AM
  4. Explain #define preprocessor directive
    By Javiier in forum Software Development
    Replies: 3
    Last Post: 14-11-2009, 10:12 PM
  5. Replies: 0
    Last Post: 04-06-2009, 10:49 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,402,734.20247 seconds with 17 queries