Syntax
#include <direct.h> int _getdrive(void);Description
An alternative to this function is the DosQueryCurrentDisk call.
This example gets and prints the current working drive number.
#include <stdio.h>
#include <direct.h>
int main(void)
{
printf("Current working drive is %d.\n", _getdrive());
return 0;
/****************************************************************************
The output should be similar to:
Current working drive is 5.
****************************************************************************/
}
Related Information