This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/clibexam/_expand.c

23 lines
613 B
C
Raw Normal View History

#include <stdio.h>
#include <malloc.h>
void main()
{
char *buf;
char __far *buf2;
buf = (char *) malloc( 80 );
printf( "Size of buffer is %u\n", _msize(buf) );
if( _expand( buf, 100 ) == NULL ) {
printf( "Unable to expand buffer\n" );
}
printf( "New size of buffer is %u\n", _msize(buf) );
buf2 = (char __far *) _fmalloc( 2000 );
printf( "Size of far buffer is %u\n", _fmsize(buf2) );
if( _fexpand( buf2, 8000 ) == NULL ) {
printf( "Unable to expand far buffer\n" );
}
printf( "New size of far buffer is %u\n",
_fmsize(buf2) );
}