Category : Files from Magazines
Archive   : CGAZV5N5.ZIP
Filename : LIST7.C

 
Output of file : LIST7.C contained in archive : CGAZV5N5.ZIP
/*---------------------------------------- Listing 7 ------
* Demonstration of assert().
* See Listing 1 for copyright terms.
*-------------------------------------------------------*/
#include
#include

/*---------------------------------------------------------
* If the following line is un-commented, assert will
* cease to function.
*-------------------------------------------------------*/

/* #define NDEBUG */
#include

void main ( void );
void Write ( FILE *Handle, char String[] );
void SigHndlr ( int Signal, int SubCode );

void main()
{
signal ( SIGABRT, SigHndlr );

/*---------------------------------------------------------
* Some poor soul doesn't understand Write()'s
* parameter requirements.
*-------------------------------------------------------*/

Write ( NULL, "Top of File\n" );
}


void Write ( FILE *Handle, char String[] )
{
/* Make sure we're getting valid parameters! */

assert ( String != NULL );
assert ( Handle != NULL );

fprintf ( Handle, "%s\n", String );
}


void SigHndlr ( int Signal, int SubCode )
{
fprintf ( stderr, "Signal %d, %d raised\n",
Signal, SubCode );
}

  3 Responses to “Category : Files from Magazines
Archive   : CGAZV5N5.ZIP
Filename : LIST7.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/