Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Linux编程 > » 正文

Windows_Programing_English_To_Chinese_1_MSVC_C运行库(24)

来源: 未知 分享至:

The use

功能

Change the current working directory.

切换当前工作目录

The prototype

函数原型

int _chdir(const char *dirname);

/* for wide character */

int _wchdir(const wchar_t *dirname);

Example

实例

charpath1[50] = \"C:\\WINNT\\System32\\config\";

_chdir(path1);

The parameters

参数

dirname - Path of new working directory.

Dirname- 工作目录的完整路径

The return value

返回值

These functions return a value of 0 if successful.  A return value of 1 indicates that the specified path

 could not be found, in which case errno is set to  ENOENT.

函数成功执行返回0值。

返回值= -1 时表示找不到指定路径,

当函数执行失败,用GetLastError函数获取的返回值为 ENOENT

The header file

头文件

<direct.h> or <wchar.h> for_wchdir().

Table 8:  _chdir(),_wchdir() functions information

8  _chdir(),_wchdir()函数

§ The _chdir() function changes the current working directory to the directory specified by dirname.  The dirname parameter must refer to an existing directory.

§ _chdir()


Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史