system("mkdir C:\\Users\\USER\\Desktop\\test");
,我發現這個然而,這並不工作,因爲我的代碼看起來像這樣用戶自定義的C++系統功能目錄執行從
string inputFAT = "input.FAT";
string outputdirecotry = "adirectory";
string exepath = "FATool.exe";
cout << "enter the directory you would like to have the files put out to";
getline(cin, outputdirecotry);
string outputdirectorycommand = "cd " + outputdirecotry;
cout << "enter the path of the file you want to extract";
getline(cin, inputFAT);
cout << "enter the path to the FATool executable";
getline(cin, exepath);
string exportcommand = exepath + " -x " + inputFAT;
system(outputdirectorycommand.c_str && exportcommand.c_str());
,你可以看到我需要的用戶定義的目錄該系統功能需要去,當我試圖建立它,它拋出這些錯誤
嚴重性代碼說明項目文件的線路抑制狀態 錯誤C3867「的std :: basic_string的,性病::分配器> :: c_str':非標準語法;使用 '&' 創建一個指向成員FATool ++ C:\用戶\拉斯\文件\的Visual Studio 2015年\項目\ fatool ++ \ fatool ++ \ main.cpp中24
而且這個
嚴重性代碼說明項目文件行抑制狀態 錯誤C2664'int system(const char *)':無法將參數1從'bool'轉換爲'const char *'FATool ++ c:\ users \ russ \ documents \ visual studio 2015 \ projects \ fatool ++ \ fatool ++ \ main.cpp 24
所以它甚至有可能做到這一點,或者我應該只是把我的損失,並定義目錄我和有我的朋友們進入代碼和做同樣的事情
哇好感謝我從來沒有教過這樣做,它現在似乎很明顯 –