Programming Puzzle --Write a Code that executes certain function only at Program termination

Use atexit( ) function as shown in following program.

#include
main( )
{
int ch ;
void fun ( void ) ;
atexit ( fun ) ;
// code
}
void fun( void )
{
printf ( "\nTerminate program......" ) ;
getch( ) ;
}

No comments:

Post a Comment

comment on this post

Note: Only a member of this blog may post a comment.