Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > chdrive

chdrive

Example: chdrive File Manipulation Functions

Switches to another drive on a Windows operating system.

int  chdrive( int drive); 

drive The name of a drive.

chdrive changes the current working drive to be drive, an integer representing the new drive. (1 = A, 2 = B, etc.)

Return Values

The chdrive function returns zero on success and (-1) for failure.