阅读背景:

使用C ++更改Linux中的当前目录

来源:互联网 

I have the following code:

我有以下代码:

#include <iostream>
#include <string>
#include <unistd.h>

using namespace std;

int main()
{
    // Variables
    string sDirectory;

    // Ask the user for a directory to move into
    cout << "Please enter a directory..." << endl;
    cin >> sDirectory;
    cin.get();

    // Navigate to the directory specified by the user
    int chdir(sDirectory);

    return 0;
}
#include



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: