📄 subject_34126.htm
字号:
<p>
序号:34126 发表者:llisary 发表日期:2003-03-26 22:08:29
<br>主题:_getcwd怎么声明啊???
<br>内容:由于程序需要,要写上当前文件夹的路径。知道怎么用_getcwd来实现,可是程序说我没有声明,请问哈:要加一个什么头文件??<BR>多谢哈!!!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:dr0 回复日期:2003-03-26 22:41:24
<br>内容:/* This program places the name of the current directory in the <BR> * buffer array, then displays the name of the current directory <BR> * on the screen. Specifying a length of _MAX_PATH leaves room <BR> * for the longest legal path name.<BR> */<BR><BR>#include <direct.h><BR>#include <stdlib.h><BR>#include <stdio.h><BR><BR>void main( void )<BR>{<BR> char buffer[_MAX_PATH];<BR><BR> /* Get the current working directory: */<BR> if( _getcwd( buffer, _MAX_PATH ) == NULL )<BR> perror( "_getcwd error" );<BR> else<BR> printf( "%s\n", buffer );<BR>}<BR><BR>
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -