C语言函数大全(p开头)2010-01-29函数名: parsfnm功能: 分析文件名用法: char *parsfnm (char *cmdline, struct fcb *fcbptr, int option);程序例:#include #include #include #include int main(void) { char line[80]; struct fcb blk; /* get file name */ printf("Enter drive and file name (no path - ie. a:file.dat)
"); gets(line); /* put file name in fcb */ if (parsfnm(line, &blk, 1) == NULL) printf("Error in parsfm call
"); else printf("Drive #%d Name: %11s
", blk.fcb_drive, blk.fcb_name); return 0; }函数名: peek功能: 检查存储单元用法: int peek(int segment, unsigned offset);程序例:#include #include #include int main(void) { int value = 0; printf("The current status of your keyboard is:
"); value = peek(0x0040, 0x0017); if (value & 1) printf("Right shift on
"); else printf("Right shift off
"); if (value & 2) printf("Left shift on
"); else printf("Left shift off
"); if (value & 4) printf("Control key on
"); else printf("Control key off
"); if (value & 8) printf("Alt key on
"); else printf("Alt key off
"); if (value & 16) printf("Scroll lock on
"); else printf("Scroll lock off
"); if (value & 32) printf("Num lock on
"); else printf("Num lock off
"); if (value & 64) printf("Caps lock on
"); else printf("Caps lock off
"); return 0; }