请输入您要查询的百科知识:

 

词条 _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:\" );

// 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( '\' );

}

}

// Restore original drive.

_chdrive( curdrive );

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/2/7 17:16:05