Export (0) Print
Expand All
div
Expand Minimize

_chdrive

Changes the current working drive.

int _chdrive( 
   int drive 
);

Parameter

drive
Number of new working drive.

Return Value

_chdrive returns a value of 0 if the working drive is successfully changed. A return value of –1 indicates an error.

Remarks

The _chdrive function changes the current working drive to the drive specified by drive. The drive parameter uses an integer to specify the new working drive (1=A, 2=B, and so forth). This function changes only the working drive; _chdir changes the working directory.

Requirements

Routine Required header Compatibility
_chdrive <direct.h> Win 98, Win Me, Win NT, Win 2000, Win XP

For additional compatibility information, see Compatibility in the Introduction.

Libraries

All versions of the C run-time libraries.

Example

See the example for _getdrive.

See Also

Directory Control Routines | _chdir | _fullpath | _getcwd | _getdrive | _mkdir | _rmdir | system | Run-Time Routines and .NET Framework Equivalents

Show:
© 2014 Microsoft