勇敢心资源网

当前位置:首页 > 百科 / 正文

_wgetdcwd

(2020-08-24 16:42:29) 百科

_wgetdcwd

_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 );
}
声明:此文信息来源于网络,登载此文只为提供信息参考,并不用于任何商业目的。如有侵权,请及时联系我们:baisebaisebaise@yeah.net
搜索
随机推荐

勇敢心资源网|豫ICP备19027550号