Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_dos_getdrive() get identifier of current disk drive</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _dos_getdrive()         Get identifier of current disk drive

 #include   <dos.h>

  void    _dos_getdrive(drive);
  unsigned *drive;       Location of returned drive ID

    _dos_getdrive() uses MS-DOS function 19h to obtain the identifier of
    the current disk drive. The identifier is returned in 'drive', where
    1 = drive A, 2 = drive B, and so on.

   Portability:     MS-DOS only, version 1.0 or higher

------------------------------- Example ---------------------------------

 This program gets the current drive identifier

           #include <dos.h>

           char drive[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZ";

           main()
           {
              unsigned drive_id;

              _dos_getdrive (&drive_id);
              printf("The current disk drive is %c:\n", drive[drive_id]);
           }


See Also: _dos_getdiskfree() _dos_setdrive()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson