欢迎来到天天文库
浏览记录
ID:32657749
大小:61.12 KB
页数:17页
时间:2019-02-14
《c语言函数大全(p开头)》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、函数大全(p开头)61函数名:parsfnm功能:分析文件名用法:char*parsfnm(char*cmdline,structfcb*fcbptr,intoption);程序例:#include#include#include#includeintmain(void){charline[80];structfcbblk;/*getfilename*/printf(MEnterdriveandfilename(nopath-ie.a:file.dat)M);gets(line);/*putfilena
2、meinfcb*/if(parsfnm(line,&blk,1)==NULL)printf(MErrorinparsfmcallH);elseprintf("Drive#%dName:%1ls",blk.fcb_drive,blk.fcb_name);return0;函数名:peek功能:检查存储单元用法:intpeek(intsegment,unsignedoffset);程序例:#include#include#includeintmain(void)intvalue=0;prinif(=ThecurrentsUHus
3、ofyourkeyboardis,n=);valueHPeek(oxoo4p0x0017)八if(value1)PS-二f(--Rightshiftonm=)八elseprintaRightshift05n=)八if(value2)primf(=Lefrshiftonvr.relseprin-fTLenshiftO51T);if(value&.4)printf(=con=rolkeyon=)_elseprin.s=co=ro】keyoff=)八if(valueRp8)printf(=Alrkeyon=)一elseprins->-tkey03=)if(vace8l16)
4、prin〔f(=scro=ock02n=relseprimf(=scro=ockoff=);if(vace8c32)primf(=Numlockon=);elseprinif(=Numockoff=);if(vace8l64)primacapslockonw);elseprimf(二capsock03=)rerun-p因磬Ik【peekb功能:检查存储单元用法:charpeekb(intsegment,unsignedoffset);程序例:#include#include#includeintmain(void){i
5、ntvalue=0;printf("Thecurrentstatusofyourkeyboardis:");value=peekb(0x0040,0x0017);if(value&1)printf("Rightshifton");elseprintf(MRightshiftoffM);if(value&2)printf("Leftshifton");elseprintf("LeftshiftoffH);if(value&4)printf(''ControlkeyonH);elseprintf("Controlkeyoff");if(value&8)pr
6、intf("Altkeyon");elseprintf("AltkeyoflAn");if(value&16)printf("Scrolllockonu);elseprintfC'Scrolllockoff,f);if(value&32)printfC'Numlockonu);elseprintf("Numlockoffu);if(value&64)printfC'Capslockon");elseprintf(HCapslockoff");return0;函数名:perror功能:系统错误信息用法:voidperror(char^string);程序
7、例:#includeintmain(void){FILE*fp;fp=fopen("peiTor.dat'"r");perror(HUnabletoopenfileforreading0);return0;函数名:pieslice功能:绘制并填充一个扇形用法:voidfarpieslice(intx,intstanle,intendangle,intradius);程序例:#include#include#inclu
此文档下载收益归作者所有