• / 17
  • 下载费用:10 金币  

C语言函数大全-F篇.doc

关 键 词:
C语言函数大全-F篇.doc
资源描述:
F:函数名: farcalloc功 能: 从远堆栈中申请空间用 法: void far *farcalloc(unsigned long units, unsigned ling unitsz);程序例:#include #include #include #include int main(void){char far *fptr;char *str = “Hello“;/* allocate memory for the far pointer */fptr = farcalloc(10, sizeof(char));/* copy “Hello“ into allocated memory *//*Note: movedata is used because youmight be in a small data model, inwhich case a normal string copy routinecan not be used since it assumes thepointer size is near.*/movedata(FP_SEG(str), FP_OFF(str),FP_SEG(fptr), FP_OFF(fptr),strlen(str));/* display string (note the F modifier) */printf(“Far string is: %Fs\n“, fptr);/* free the memory */farfree(fptr);return 0;} 函数名: farcoreleft功 能: 返回远堆中未作用存储区大小用 法: long farcoreleft(void);程序例:#include #include int main(void){printf(“The difference between the\highest allocated block in the\far\n“);printf(“heap and the top of the far heap\is: %lu bytes\n“, farcoreleft());return 0;} 函数名: farfree功 能: 从远堆中释放一块用 法: void farfree(void);程序例:#include #include #include #include int main(void){char far *fptr;char *str = “Hello“;/* allocate memory for the far pointer */fptr = farcalloc(10, sizeof(char));/* copy “Hello“ into allocated memory *//*Note: movedata is used because you might be in a small data model,in which case a normal string copy routine can't be used since itassumes the pointer size is near.*/movedata(FP_SEG(str), FP_OFF(str),FP_SEG(fptr), FP_OFF(fptr),strlen(str));/* display string (note the F modifier) */printf(“Far string is: %Fs\n“, fptr);/* free the memory */farfree(fptr);return 0;} 函数名: farmalloc功 能: 从远堆中分配存储块用 法: void far *farmalloc(unsigned long size);程序例:#include #include #include #include int main(void){char far *fptr;char *str = “Hello“;/* allocate memory for the far pointer */fptr = farmalloc(10);/* copy “Hello“ into allocated memory *//*Note: movedata is used because we mightbe in a small data model, in which casea normal string copy routine can not beused since it assumes the pointer sizeis near.*/movedata(FP_SEG(s
展开阅读全文
  微传网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
0条评论

还可以输入200字符

暂无评论,赶快抢占沙发吧。

关于本文
本文标题:C语言函数大全-F篇.doc
链接地址:https://www.weizhuannet.com/p-9478717.html
微传网是一个办公文档、学习资料下载的在线文档分享平台!

微传网博客

网站资源均来自网络,如有侵权,请联系客服删除!

 网站客服QQ:80879498  会员QQ群:727456886

copyright@ 2018-2028 微传网络工作室版权所有

     经营许可证编号:冀ICP备18006529号-1 ,公安局备案号:13028102000124

收起
展开