'Exception Object Address: 0x995ADA' Process stopped

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xuxf055
    New Member
    • Jan 2007
    • 6

    '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:
    Code:
    #include <iostream>
    using namespace std;
    void main ()
    {
    int a = 0;
    int b;
      try
      {
      while(a != 4)
      {
      cout<<"Please input a number!! "<<endl;
      cin>>a;
      }
      if(a == 4)
      throw a;
      }
      catch (int a)
      {
        cout << "An exception occurred. Exception Nr. " << endl;
      }
    
    }
  • horace1
    Recognized Expert Top Contributor
    • Nov 2006
    • 1510

    #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?

    Comment

    • xuxf055
      New Member
      • Jan 2007
      • 6

      #3
      Originally posted by horace1
      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?

      Comment

      • AdrianH
        Recognized Expert Top Contributor
        • Feb 2007
        • 1251

        #4
        Originally posted by xuxf055
        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

        Comment

        • xuxf055
          New Member
          • Jan 2007
          • 6

          #5
          Originally posted by AdrianH
          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.

          Comment

          • AdrianH
            Recognized Expert Top Contributor
            • Feb 2007
            • 1251

            #6
            Originally posted by xuxf055
            hi,
            Adrian
            Thank you so much, what you said is totally right.
            Thanks again.
            No prob, glad to help.


            Adrian

            Comment

            Working...