词条 | getcurdir |
释义 | 函数名: getcurdir 功 能: 取指定驱动器的当前目录 用 法: int getcurdir(int drive, char *direc); 程序例: #include <dir.h> #include <stdio.h> #include <string.h> char *current_directory(char *path) { strcpy(path, "X:\\\\"); /* fill string with form of response: X:\\ */ path[0] = 'A' + getdisk(); /* replace X with current drive letter */ getcurdir(0, path+3); /* fill rest of string with current directory */ return(path); } int main(void) { char curdir[MAXPATH]; current_directory(curdir); printf("The current directory is %s\", curdir); return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。