有什么办法可以使用C语言更改目录吗? [英] Is there any way to change directory using C language?

查看:23
本文介绍了有什么办法可以使用C语言更改目录吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以通过执行 C 程序切换到任何目录?

Is there any way by which I can change to any directory by executing a C program?

推荐答案

根据您的操作系统,有不同的更改当前目录的调用.这些通常只会更改运行可执行文件的进程的当前目录.进程退出后,您将进入您开始所在的目录.

Depending on your OS there are different calls for changing the current directory. These will normally only change the current dir of the process running the executable. After the process exits you will be in the directory you started in.

这篇关于有什么办法可以使用C语言更改目录吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆