Category : C Source Code
Archive   : CBIBLE.ZIP
Filename : FAREALOC.C

 
Output of file : FAREALOC.C contained in archive : CBIBLE.ZIP
/* farealoc.c --- p. 134 */
# include
# include
main()
{
int far *block1, *block2;
if((block1 = farmalloc(1000L)) == NULL)
{
printf("Block1 allocation failed!\n");
exit(1);
}
printf("First block of 1,000 bytes allocated at %Fp\n",block1);
if((block2 = farmalloc(100L)) == NULL)
{
printf("Block2 allocation failed!\n");
exit(1);
}
printf("Second block of 100 bytes allocated at %Fp\n",block2);
if((block1 = farrealloc(block1, 80000L)) == NULL)
{
printf("Block1 allocation failed!\n");
exit(1);
}
printf("Size of first block adjusted to 80,000 bytes at %Fp\n",
block1);
}

  3 Responses to “Category : C Source Code
Archive   : CBIBLE.ZIP
Filename : FAREALOC.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/