本次教大家如何不用手动在计算机磁盘中同时创建任意个文件夹!(只要你计算机内存足够大)
#include <iostream>
#include <fstream>
#include <string>
#include <direct.h>
using namespace std;
int main()
{
string fileName;
char dirName[100];
char s[50];
int i=0;
ifstream infile;
cout<<"请输入用于批量创建文件夹的文件名:";
cin>>fileName;
infile.open(fileName);
try
{
if(infile.fail())
throw fileName;
}
catch (string exp)
{
cout<<"打开文件\""<<exp<<"\"出现错误!\n";
return -1;
}
cout<<"请输入批量创建文件夹所在的磁盘与路径:&