_wgetdcwd是一种计算机术语,C语言函式,原型为wchar_t *_wgetdcwd()。
基本介绍
- 中文名:_wgetdcwd
- 所属库:direct.h或wchar.h
- 性质:计算机术语
- 类型:C语言函式
- 函式原型:wchar_t *_wgetdcwd(
简介
C语言函式
函式简介
函式名称:_wgetdcwd
函式功能及返回值:返回指定的驱动器上当前工作目录的完整路径(绝对路径)
所属库:direct.h或wchar.h
函式原型:
wchar_t *_wgetdcwd(
int drive,
wchar_t *buffer,
int maxlen
);
相关函式:_getdcwd
程式示例
// crt_getdrive.c
// compile with: /c
// Illustrates drive functions including:
// _getdrive _chdrive _getdcwd
//
#include <stdio.h>
#include <direct.h>
#include <stdlib.h>
#include <ctype.h>
int main( void )
{
int ch, drive, curdrive;
static char path[_MAX_PATH];
// Save current drive.
curdrive = _getdrive();
printf( "Available drives are:\n" );
// If we can switch to the drive, it exists.
for( drive = 1; drive <= 26; drive++ )
{
if( !_chdrive( drive ) )
{
printf( "%c:", drive + 'A' - 1 );
if( _getdcwd( drive, path, _MAX_PATH ) != NULL )
printf( " (Current directory is %s)", path );
putchar( '\n' );
}
}
// Restore original drive.
_chdrive( curdrive );
}