Use of '#pragma startup' and '#pragma exit'


    #include <iostream.h>
    #include <conio.h>
    /* functions declared before the 'pragma' lines */
    void start ( void ) ;
    void end ( void ) ;
    /* 'pragma' directives */
    #pragma startup start
    #pragma exit end
    void main()
    {
        cout << "\n\nProgram Body\n\n\n"  ;
        getch () ;
    }
    void start (void) /* function to be called before 'main()' */
    {
        clrscr () ;
        cout << "PROGRAM STARTS HERE...\n" ;
        getch () ;
    }
    void end (void) /* function to be called before program termination */
    {
        cout << "PROGRAM ENDS HERE...\n" ;
        getch () ;
    }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|