C语言函数—allocmem

函数名

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: %xn", segp); 
  else 
     printf("Failed: maximum number of paragraphs available is %un", 
            stat); 

  return 0; 
} 
如果引用本站的原创文章,请注明原文链接:,本站保留追究责任的权利!

发表评论