If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

That message means the program called "terminate()" or threw an unhandled exception.

To find this, run the program in your debugger and it should break for you when the problem happens. I see that your program has some "throw" commands, so very likely the issue is from one of them. Every throw needs a catch, unless you LIKE having the program exit upon error (generally this is not a great plan, but if your system could cause real world damage upon error, sometimes exiting is safer than the unknown. Its still a poor idea, but you see this sometimes, thats what a windows blue or red screen of death really means, windows felt it might damage hardware or the file system and stopped before it could get any worse).

Throw...Catch question

Ok, I understand what you're saying, but I am wondering if I just handled the throwing and catching incorrectly. Can I throw an exception from a class and catch it in main? If so, shouldn't catch(...) catch anything thrown? I thought that was what my professor said.....

modify throw("Incorrectly formatted owner Name");
to throw std::string("Incorrectly formatted owner Name");
unfortunately, this is an error that can not be caught by a typical debugger using normal debugging techniques - you need to debug at the assembly level.

another error you will encounter, once you have fixed this one is in the function istream &operator>>(istream &istr, CustomerData cd). in these lines:

after istr >> temp2 ; the stream buffer will contain the white-space character which ends the input for temp2. istr.getline(temp3, 256); will now encounter this white-space character in the buffer and treat it as part of the input to be read. modify to:

Another question

Ok guys thanks for all of your replies, I fixed those errors, but now I have a different problem with my istream. I don't think that it is reading any information in from the filestream that I have in main. It throws the "too short" string every time. If I change the initialization of temp from "" to "Not short" it goes through that just fine, but then the next field with throw it's error, confirming my thought that it's not inputing properly. Any ideas?

perhaps, you have not been able to open the file at all. (there is no file "test.txt" in the current directory). and you are testing only for eof() and not bad() etc. make sure that you are able to open the file and read it by writing a small test program:

You generally want to always do this with objects to prevent copying tons of data behind your back. When you pass by reference (the &), the compiler only passes a pointer (a single integer's worth of data is moved through the sysem) whereas, without the &, you copy every data member of the class, potentially hundreds of wasted copys per function call, a performance killer if the function is called a lot. You can use the const keyword to prevent accidental modification of the incoming object (compiler will not let you do it).