《C语言函数大全(p开头).docx》由会员分享,可在线阅读,更多相关《C语言函数大全(p开头).docx(5页珍藏版)》请在金锄头文库上搜索。
1、 C语言函数大全(p开头)功 能: 分析文件名用 法: char *parsfnm (char *cmdline, struct fcb *fcbptr, int option);程序例:#include#include#include#includeint main(void)char line80;struct fcb blk;/* get file name */printf(“Enter drive and file name (no path - ie. a:file.dat)n“);gets(line);/* put file name in fcb */if (parsfnm(l
2、ine,elseprintf(“Drive #%d Name: %11sn“, blk.fcb_drive, blk.fcb_name);return 0; 函数名: peek功 能: 检查存储单元用 法: int peek(int segment, unsigned offset);程序例:#include#include#includeint main(void)int value = 0;printf(“The current status of your keyboard is:n“);value = peek(0x0040, 0x0017);if (valueelseprintf(“
3、Right shift offn“);if (valueelseprintf(“Left shift offn“);if (valueelseprintf(“Control key offn“);if (valueelseprintf(“Alt key offn“);if (valueelseprintf(“Scroll lock offn“);if (valueelseprintf(“Num lock offn“);if (valueelseprintf(“Caps lock offn“);return 0; 函数名: peekb功 能: 检查存储单元用 法: char peekb (int
4、 segment, unsigned offset);程序例:#include#include#includeint main(void)int value = 0;printf(“The current status of your keyboard is:n“);value = peekb(0x0040, 0x0017);if (valueelseprintf(“Right shift offn“);if (valueelseprintf(“Left shift offn“);if (valueelseprintf(“Control key offn“);if (valueelseprintf(“Alt key offn“);if (valueelseprintf(“Scroll lock offn“);if (valueelseprintf(“Num lock offn“);if (valueelseprintf(“Caps lock offn“);return 0;