Hey there, I need help getting input from the user with whitespace. Basically I'm prompting the user for a file name, and i want it to read the input if they include a space.
Here's my code so far:
1 2 3 4 5 6 7 8 9 10 11
int main()
{
cout << "Enter a file name (including extension): " << endl;
cin >> FileName;
ifstream input(FileName);
if (!input.good())
{
cerr << "Unable to open file" << endl;
exit(1);
}
i thought i could use skipws , but i don't know if im using it right.