Apr 12, 2015 at 4:00pm UTC
Edit: Misread the code. The file name is obviously a string, not a number right?
string file;
Last edited on Apr 12, 2015 at 4:01pm UTC
Apr 12, 2015 at 4:03pm UTC
So then how would I allow the user to enter the file location?
Apr 12, 2015 at 4:06pm UTC
The file name in this case is numbers.txt
Apr 12, 2015 at 4:07pm UTC
"C:/my file.txt"
is an example of a string.
Apr 12, 2015 at 4:10pm UTC
I now see the error that I'm trying to make a file type of float allow a char to be entered. But that still doesn't fix my problem. But thank you for point that out.
Apr 12, 2015 at 4:12pm UTC
Change it from float to string. And use getline(cin, file);
instead of cin >>
Apr 12, 2015 at 4:13pm UTC
What error is it giving you now?
Apr 12, 2015 at 4:15pm UTC
Thanks that did it, your awesome!