KyaPoocha.com

Huge Collection of Interview Questions


How to obtain the current drive through C ? 

We can use the function _getdrive( ) to obtain the current drive. The _getdrive( ) function uses DOS function 0X19 to get the current drive number

#include
main( )
{
int disk ;
disk = _getdrive( ) + ‘A’ - 1 ;
printf ( “The current drive is: %c\n”, disk ) ;
}



If you liked this question/asnwer, make sure you
Subscribe to KyaPoocha.com RSS feed!


BOOKMARK THIS : BlinkList | del.icio.us | Digg it | Furl | reddit | StumbleUpon | Yahoo MyWeb |