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

getdrive

Example: getdrive File Manipulation Functions

Returns the name of the current drive. Windows only.

int getdrive( void); 

The getdrive function returns an integer representing the drive letter: 1 = A, 2 = B, etc.

Return Values

This function returns zero upon success and (-1) for failure.