c++, Debian linux system, g++ compiler
Alright, I have a serious problem. I keep getting a segmentation fault everytime cin recieves a string with a period in it and stores it into a string. I used couts to find the location of the segmentation fault. it happens EXACTLY after cin >> myString;
is called, and only when I input "map.txt". It mighthave something to do with the period directly in the middle. Maybe it'll happen with other characters, but the one I need is a period.
It won't happen if I input "map." , ".txt" , "map..txt" or "hello.txt" but "map.txt" gives a segmentation fault before the-line-after the input. It will happen with either cin >> or getline( cin , myString ).
The reason I need this to work is so I can read in the file in a ifstream In;
, using In.open( myString.c_str() )
. But I can't do that if it gives me a segmentation fault everytime I input the right name for the file! I just need to know why this isn't working. Any help is appreciated. I might still have some muffins for everyone who helps ^_^