setblock

函数名: setblock

功 能: 修改先前已分配的DOS存储段大小

用 法: int setblock(int seg, int newsize);

函数元浆名: setblock

功舟拜格精 能: 修改先前循龙背已分配的DOS存储段大小

用 法: int setblock(int seg, int newsize);

#include <dos.h>

#include <alloc.h>

#include <stdio.h>只记寻料

#include <stdlib.h>

int main(void)

{

unsigned int size, segp;

int stat;

size = 64; /* (64 x 16) = 1024 bytes */

stat = allocmem(size, &segp);

if (stat == -1)

printf("Allocated memory at segment: %X\n"夜洒拒蒸雄台, segp);

else

{

printf("采您腿Failed: maximum number of paragraphs available is %d\n",

stat);

exit(1);

}

stat = setblock(segp, size * 2);

if (stat == -1)

printf("Expanded memory block at segment: %X\n", segp);

else

printf("Failed: maximum number of paragraphs available is %d\n",

stat);

freemem(segp);

return 0;

}

相关词汇