首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

linux,有类似于vc的SetCurrentDirectory函数吗?解决办法

2012-03-22 
linux,有类似于vc的SetCurrentDirectory函数吗?如运行绝对路径/home/MyFolder/MyApp.out在MyApp中代码mkdi

linux,有类似于vc的SetCurrentDirectory函数吗?
如运行绝对路径/home/MyFolder/MyApp.out

在MyApp中代码mkdir( "LOG ",...),会将LOG创建在当前目录,我想创建在/home/MyFolder下,有SetCurrentDirectory函数吗?

[解决办法]
#include <unistd.h>
int chdir(const char *path);

[解决办法]
你在创建文件时写全路径名嘛。

热点排行