Ok so I have a problem with getline.
I have a file that contains a couple strings. I created it by myself and I have each string on a seperate line.
Ex. textfile.txt
Line 1
Line 2
Line 3
Line 4
//Little snip of code
ifstream inFile("textfile.txt");
getline(inFile, string1);
When I debug the program and ask it to print out string1 it shows that "Line 1\r" is saved into string1. I understand that it's from me actually hitting enter when I created the file. This problem causes my program to have a segmentation fault. I know my code works because if I use ofstream to write the file first and then i read it in, it works.
So for my quesiton, is their anyway to use the getline function without it picking up the escape sequence \r? If i am not clear just let me know.