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

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

Windows_Programing_English_To_Chinese_1_MSVC_C运行库(25)

来源: 未知 分享至:
函数将当前工作路径改变通过dirname指定的路径。Dirname必须是系统存在的目录,(译注:该函数实现CD的功能)

§ This function can change the current working directory on any drive.  If a new drive letter is specified in dirname, the default drive letter will be changed as well.

§ 本函数可以将当前工作目录切换至其他任意的驱动器,如果通过dirname指定新的驱动器盘符,那么默认的(译注:当前的)驱动器盘符也会改变。

§ For example, if A is the default drive letter and BIN is the current working directory, the following call changes the current working directory for drive

 C and establishes C as the new default drive:

§ 例如: 如果A是默认驱动器盘符(译注:当前驱动器盘符),同时bin 是当前工作目录, 下面的函数调用将会时当前工作目录改变至C盘下temp目录。

_chdir(\"c:\\temp\");

§ When you use the optional backslash character () in paths, you must place two backslashes (\\) in a C string literal to represent a single backslash ().

§ 因为在C语言中反斜杠  符号有特定的意义,因此当指定路径时如果存在  符号时,那么必须使用 \\ 这样的形式来表示  符号。

§ _wchdir() is a wide-character version of _chdir().  The dirname argument to _wchdir() is a wide-character string.  _wchdir() and _chdir() behave identically otherwise.

§ _wchdir()函数是宽字符版本的_chdir() 函数, 对_wchdir()函数dirname是一个宽字符集的字符串。

§ Let use some of the functions in our programs.  You can follow the same steps for other functions :o).  The following is a program example that uses some of the functions.

§ 让我们在程序中使用这些函数,  你可以通过同样的步骤来测试其他的函数, 下面是一个如何使用这些函数的程序实例:

/*******cruntime.cpp*******/

/***Visual C++ .Net/7.0****/

#include<stdio.h>

#include<conio.h>

#include<direct.h>

#include<stdlib.h>

#include<ctype.h>


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