§ 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>