470,588 Members | 2,103 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,588 developers. It's quick & easy.

'Exception Object Address: 0x995ADA' Process stopped

Hi
I want to know why my pc deal with the exception is:
the following informations:
Project Project 1.exe raised exception class int with message 'Exception Object Address: 0x995ADA' Process stopped. Use Step or Run to continue.
I do not why, the code is as following:
Expand|Select|Wrap|Line Numbers
  1.  
  2. #include <iostream>
  3. using namespace std;
  4. void main ()
  5. {
  6. int a = 0;
  7. int b;
  8.   try
  9.   {
  10.   while(a != 4)
  11.   {
  12.   cout<<"Please input a number!! "<<endl;
  13.   cin>>a;
  14.   }
  15.   if(a == 4)
  16.   throw a;
  17.   }
  18.   catch (int a)
  19.   {
  20.     cout << "An exception occurred. Exception Nr. " << endl;
  21.   }
  22.  
  23. }
  24.  
Feb 5 '07 #1
5 2830
horace1
1,510 Expert 1GB
cannot see any problem with you code - if I run it I can enter numbers until I enter 4 when I get "An exception occurred. Exception Nr. " as expected
what compiler/operating system are you using?
Feb 5 '07 #2
cannot see any problem with you code - if I run it I can enter numbers until I enter 4 when I get "An exception occurred. Exception Nr. " as expected
what compiler/operating system are you using?
I use C++ Builder 6.0
I do not know why?
Feb 6 '07 #3
AdrianH
1,251 Expert 1GB
I use C++ Builder 6.0
I do not know why?
Ummm, you may want to turn exception handling on. I haven't use C++ Builder before, but I know some compilers turn it off by default as stack unwinding has a bunch of overhead that in some cases people do not want. Why wouldn't they want it? Because, if you don't use exceptions then the compiler is generating the overhead for nothing.

Hope this helps.


Adrian
Feb 6 '07 #4
Ummm, you may want to turn exception handling on. I haven't use C++ Builder before, but I know some compilers turn it off by default as stack unwinding has a bunch of overhead that in some cases people do not want. Why wouldn't they want it? Because, if you don't use exceptions then the compiler is generating the overhead for nothing.

Hope this helps.


Adrian
hi,
Adrian
Thank you so much, what you said is totally right.
Thanks again.
Feb 6 '07 #5
AdrianH
1,251 Expert 1GB
hi,
Adrian
Thank you so much, what you said is totally right.
Thanks again.
No prob, glad to help.


Adrian
Feb 7 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Saravanan | last post: by
5 posts views Thread by Nick Flandry | last post: by
2 posts views Thread by Richard Collette | last post: by
reply views Thread by mike.varley1 | last post: by
4 posts views Thread by Dilip | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.