Hey guys, I'm making a program that asks the user to input a folder path (string), which it then displays the contents of said directory, but the problem I have is that it won't accept space bars, it just screws up and enters into an infinite loop.
So is there any way to integrate something into this code to get the preffered effect?
string cFolder;
cout << "Enter a folder path to browse:" << endl;
cin >> cFolder;
chdir(cFolder.c_str());
opendir(cFolder.c_str());
system("DIR");
Any help would be greatly appreciated :D