Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-30-2004, 04:56 AM   #1
Beta Member
 
Join Date: Dec 2004
Posts: 2
Default help with use of 'runtime_error' in C++

Ok, hi.
I have been folllowing 'SAMS Teach Youself C++' and have been going fine until the chapter on runtime errors. Here is what the compiler says:

http://img67.exs.cx/img67/9315/compiler0gp.jpg

I have 5 files:
main.cpp
ErrorHandlingModule.cpp
ErrorHandlingModule.h
PromptModule.cpp
PromptModule.h

The code that is of concern is:

CODE
default:
throw
runtime_error
("Error - Invalid operator");

- in main.cpp


CODE
catch (runtime_error RuntimeError)
{
SAMSErrorHandling::HandleRuntimeError(RuntimeError );
}

- in main.cpp


CODE
int HandleRuntimeError(runtime_error RuntimeError)

- in ErrorHandlingModule.h


CODE
int HandleRuntimeError(runtime_error RuntimeError)//returns the error code
{
cerr <<
RuntimeError.what() << endl;

return 1;//an error ocurred
}

-in ErrorHandlingModule.cpp


Please help. I don't know how to declare runtime error and in which files. I have followed the book but it is not very helpful. If you want, I can send you the whole project though e-mail or msn or something if you cant help from the information above. Thanks very much

Kris
__________________

Kriscs1 is offline   Reply With Quote
Old 01-09-2005, 06:13 AM   #2
Beta Member
 
Join Date: Dec 2004
Posts: 2
Default

any1 ?
Kriscs1 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 11:08 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0