函式名
功能
DOS系統調用
函式語法
int bdos(int dosfun, unsigned dosdx, unsigned dosal);
程式實例
#include <stdio.h>
#include <dos.h>
/* Get current drive as 'A', 'B', ... */
char current_drive(void)
{
char curdrive;
/* Get current disk as 0, 1, ... */
curdrive = bdos(0x19, 0, 0);
return('A' + curdrive);
}
int main(void)
{
printf("The current drive is %c:\n", current_drive());
return 0;
}