problems with ifstream and ofstream!! help me please!!!
I have a nice save function, except for a minor (well major) problem. There are no errors at compile or anything like that. But when I run the program and it gets to a certain line of code I get a windows error that says "blah.exe has encountered an error and must be closed. Sorry for any inconvenience.......". You know the rest. I have windows xp. This happened once before when I didnt initialize a variable, i think. Anyhow, there is nothing like that that could cause a problem. I've zeroed in on the lines where the windows error pops up:
there are 3 others. this is in main:
...so current_room points to another variable of type room, which has an element that points to another variable of type room. this isnt the exact code, but its just about exact. i pass current_room to my saving function. when i do save>>current_room->id;, i get the windows error. It also happens with other variables that point to something. i've even tried saying something like:
and using 'id' instead of 'current_room->id'.that doesnt even work and it is a regular integer! i know that i can use current_room and things that it points to in functions because there are many others that do. this just makes no sense at all to me. when i get home i'll post the exact code, but i've pretty much explained it all. It makes no sense! help!