ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:18.63KB ,
资源ID:5844828      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/5844828.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(函数大全p开头解读.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

函数大全p开头解读.docx

1、函数大全p开头解读函数大全(p开头)函数名:parsfnm 功能:分析文件名 用法:char*parsfnm(char*cmdline,structfcb*fcbptr,intoption); 程序例: #include #include #include #includeintmain(void) charline80; structfcbblk; /*getfilename*/ printf(Enterdriveandfilename(nopath-ie.a:file.dat)n); gets(line); /*putfilenameinfcb*/ if(parsfnm(line,&blk

2、,1)=NULL) printf(Errorinparsfmcalln); else printf(Drive#%dName:%11sn,blk.fcb_drive,blk.fcb_name); return0; 函数名:peek 功能:检查存储单元 用法:intpeek(intsegment,unsignedoffset); 程序例: #include #include #include intmain(void) intvalue=0; printf(Thecurrentstatusofyourkeyboardis:n); value=peek(0x0040,0x0017); if(val

3、ue&1) printf(Rightshiftonn); else printf(Rightshiftoffn); if(value&2) printf(Leftshiftonn); else printf(Leftshiftoffn); if(value&4) printf(Controlkeyonn); else printf(Controlkeyoffn); if(value&8) printf(Altkeyonn); else printf(Altkeyoffn); if(value&16) printf(Scrolllockonn); else printf(Scrolllockof

4、fn); if(value&32) printf(Numlockonn); else printf(Numlockoffn); if(value&64) printf(Capslockonn); else printf(Capslockoffn); return0; 函数名:peekb 功能:检查存储单元 用法:charpeekb(intsegment,unsignedoffset); 程序例: #include #include #include intmain(void) intvalue=0; printf(Thecurrentstatusofyourkeyboardis:n); val

5、ue=peekb(0x0040,0x0017); if(value&1) printf(Rightshiftonn); else printf(Rightshiftoffn); if(value&2) printf(Leftshiftonn); else printf(Leftshiftoffn); if(value&4) printf(Controlkeyonn); else printf(Controlkeyoffn); if(value&8) printf(Altkeyonn); else printf(Altkeyoffn); if(value&16) printf(Scrollloc

6、konn); else printf(Scrolllockoffn); if(value&32) printf(Numlockonn); else printf(Numlockoffn); if(value&64) printf(Capslockonn); else printf(Capslockoffn); return0; 函数名:perror 功能:系统错误信息 用法:voidperror(char*string); 程序例: #include intmain(void) FILE*fp; fp=fopen(perror.dat,r); if(!fp) perror(Unabletoop

7、enfileforreading); return0; 函数名:pieslice 功能:绘制并填充一个扇形 用法:voidfarpieslice(intx,intstanle,intendangle,intradius); 程序例: #include #include #include #include intmain(void) /*requestautodetection*/ intgdriver=DETECT,gmode,errorcode; intmidx,midy; intstangle=45,endangle=135,radius=100; /*initializegraphics

8、andlocalvariables*/ initgraph(&gdriver,&gmode,); /*readresultofinitialization*/ errorcode=graphresult(); if(errorcode!=grOk)/*anerroroccurred*/ printf(Graphicserror:%sn,grapherrormsg(errorcode); printf(Pressanykeytohalt:); getch(); exit(1);/*terminatewithanerrorcode*/ midx=getmaxx()/2; midy=getmaxy(

9、)/2; /*setfillstyleanddrawapieslice*/ setfillstyle(EMPTY_FILL,getmaxcolor(); pieslice(midx,midy,stangle,endangle,radius); /*cleanup*/ getch(); closegraph(); return0; 函数名:poke 功能:存值到一个给定存储单元 用法:voidpoke(intsegment,intoffset,intvalue); 程序例: #include #include intmain(void) clrscr(); cprintf(Makesurethe

10、scrolllockkeyisoffandpressanykeyrn); getch(); poke(0x0000,0x0417,16); cprintf(Thescrolllockisnowonrn); return0; 函数名:pokeb 功能:存值到一个给定存储单元 用法:voidpokeb(intsegment,intoffset,charvalue); 程序例: #include #include intmain(void) clrscr(); cprintf(Makesurethescrolllockkeyisoffandpressanykeyrn); getch(); pokeb

11、(0x0000,0x0417,16); cprintf(Thescrolllockisnowonrn); return0; 函数名:poly 功能:根据参数产生一个多项式 用法:doublepoly(doublex,intn,doublec); 程序例: #include #include /*polynomial:x*3-2x*2+5x-1*/ intmain(void) doublearray=-1.0,5.0,-2.0,1.0; doubleresult; result=poly(2.0,3,array); printf(Thepolynomial:x*3-2.0x*2+5x-1at2.

12、0is%lfn, result); return0; 函数名:pow 功能:指数函数(x的y次方) 用法:doublepow(doublex,doubley); 程序例: #include #include intmain(void) doublex=2.0,y=3.0; printf(%lfraisedto%lfis%lfn,x,y,pow(x,y); return0; 函数名:pow10 功能:指数函数(10的p次方) 用法:doublepow10(intp); 程序例: #include #include intmain(void) doublep=3.0; printf(Tenrais

13、edto%lfis%lfn,p,pow10(p); return0; 函数名:printf 功能:产生格式化输出的函数 用法:intprintf(char*format.); 程序例: #include #include #defineI555 #defineR5.5 intmain(void) inti,j,k,l; charbuf7; char*prefix=buf; chartp20; printf(prefix6d6o8x10.2e 10.2fn); strcpy(prefix,%); for(i=0;i2;i+) for(j=0;j2;j+) for(k=0;k2;k+) for(l

14、=0;l2;l+) if(i=0)strcat(prefix,-); if(j=0)strcat(prefix,+); if(k=0)strcat(prefix,#); if(l=0)strcat(prefix,0); printf(%5s|,prefix); strcpy(tp,prefix); strcat(tp,6d|); printf(tp,I); strcpy(tp,); strcpy(tp,prefix); strcat(tp,6o|); printf(tp,I); strcpy(tp,); strcpy(tp,prefix); strcat(tp,8x|); printf(tp,

15、I); strcpy(tp,); strcpy(tp,prefix); strcat(tp,10.2e|); printf(tp,R); strcpy(tp,prefix); strcat(tp,10.2f|); printf(tp,R); printf(n); strcpy(prefix,%); return0; 函数名:putc 功能:输出一字符到指定流中 用法:intputc(intch,FILE*stream); 程序例: #include intmain(void) charmsg=Helloworldn; inti=0; while(msgi) putc(msgi+,stdout)

16、; return0; 函数名:putch 功能:输出字符到控制台 用法:intputch(intch); 程序例: #include #include intmain(void) charch=0; printf(Inputastring:); while(ch!=r) ch=getch(); putch(ch); return0; 函数名:putchar 功能:在stdout上输出字符 用法:intputchar(intch); 程序例: #include /*definesomebox-drawingcharacters*/ #defineLEFT_TOP0xDA #defineRIGHT

17、_TOP0xBF #defineHORIZ0xC4 #defineVERT0xB3 #defineLEFT_BOT0xC0 #defineRIGHT_BOT0xD9 intmain(void) chari,j; /*drawthetopofthebox*/ putchar(LEFT_TOP); for(i=0;i10;i+) putchar(HORIZ); putchar(RIGHT_TOP); putchar(n); /*drawthemiddle*/ for(i=0;i4;i+) putchar(VERT); for(j=0;j10;j+) putchar(); putchar(VERT)

18、; putchar(n); /*drawthebottom*/ putchar(LEFT_BOT); for(i=0;i10;i+) putchar(HORIZ); putchar(RIGHT_BOT); putchar(n); return0; 函数名:putenv 功能:把字符串加到当前环境中 用法:intputenv(char*envvar); 程序例: #include #include #include #include #include intmain(void) char*path,*ptr; inti=0; /*getthecurrentpathenvironment*/ pt

19、r=getenv(PATH); /*setupnewpath*/ path=malloc(strlen(ptr)+15); strcpy(path,PATH=); strcat(path,ptr); strcat(path,;c:temp); /*replacethecurrentpathanddisplaycurrentenvironment*/ putenv(path); while(environi) printf(%sn,environi+); return0; 函数名:putimage 功能:在屏幕上输出一个位图 用法:voidfarputimage(intx,inty,voidfar*bitmap,intop); 程序例: #include #include #include #include #defineARROW_SIZE10 voiddraw_arrow(intx,inty); intmain(void) /*requestautodetection*/ intgdriver=DETECT,gmode,errorcode; void*arrow; intx,y,m

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1