FREE TUTORIALS ON C programming

Saturday, January 25, 2014

The following program help to run a function upon the exiting the program


#include <stdlib.h>
#include <stdio.h>

/* Prototypes */
int fn1(void), fn2(void);

int main( void )
{
   _onexit( fn1 );
   _onexit( fn2 );
   printf( "This is executed first.\n" );
}

int fn1()
{
   system( "start /wait notepad" );
   return 0;
}

int fn2()
{
   system( "start /wait services.msc" );
   return 0;
}

9:10 PM   Posted by Unknown with No comments

0 comments:

Post a Comment

Bookmark Us

Delicious Digg Facebook Favorites More Stumbleupon Twitter

Search