编程基础-----C语言如何获取当前目录和程序目录

来源:互联网 发布:淘宝开店最少几件商品 编辑:程序博客网 时间:2024/06/06 05:03

用long getcwd(char *buf, unsigned long size);

#include <stdlib.h>#include <stdio.h>#define MAXPATH 128int main(){char buf[MAXPATH];getcwd(buf, MAXPATH);printf("The current directory is :%s \n", buf);exit(0);}


原创粉丝点击