getdrive.gml
来自「开放源码的编译器open watcom 1.6.0版的源代码」· GML 代码 · 共 29 行
GML
29 行
.func _getdrive
#include <direct.h>
int _getdrive( void );
.ixfunc2 '&DosFunc' &func
.funcend
.desc begin
The &func function returns the current (default) drive number.
.desc end
.return begin
A value of 1 is drive A, 2 is drive B, 3 is drive C, etc.
.return end
.see begin
.seelist &function. _dos_getdiskfree _dos_getdrive _dos_setdrive _getdiskfree _getdrive
.see end
.exmp begin
#include <stdio.h>
#include <direct.h>
.exmp break
void main()
{
printf( "The current drive is %c\n",
'A' + _getdrive() - 1 );
}
.exmp output
The current drive is C
.exmp end
.class DOS
.system
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?