函式名
allocmem功能
分配DOS存儲段
用法
int allocmem(unsigned size, unsigned *seg);程式實例
#include <dos.h>
#include <alloc.h>
#include <stdio.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 %u\n",
stat);
return 0;
}