Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,210 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 907 people online right now. Registration is fast and FREE... Join Now!




try/catch format

 
Reply to this topicStart new topic

try/catch format, Is "catch(...)" a propper statement

SpiderSpartan
post 11 Mar, 2008 - 01:15 PM
Post #1


D.I.C Head

Group Icon
Joined: 6 Feb, 2008
Posts: 66



Thanked 3 times

Dream Kudos: 25
My Contributions


Ok I've got this code that uses the try catch code and I'm not sure it works right with this syntax

CODE

    try
    {
        //Some Stuff
    }
        catch(CMemoryException *pEx)
    {
        //Log MemException
    }
    catch(CDBException* pEx)
    {
        //Log DBException
    }
    catch(...)
    {
        //Log default Stuff
    }
    
    return true;

Is "catch(...)" the correct syntax for the default catch statement here?
Thanks for your help.
User is offlineProfile CardPM

Go to the top of the page

letthecolorsrumble
post 11 Mar, 2008 - 02:47 PM
Post #2


Student of The Sun

Group Icon
Joined: 7 Nov, 2007
Posts: 550



Thanked 1 times
My Contributions


Yes it is the correct syntax for the catch statement...you can read about it more here ---> http://www.java2s.com/Tutorial/Cpp/0120__E...hasadefault.htm
User is offlineProfile CardPM

Go to the top of the page

SpiderSpartan
post 12 Mar, 2008 - 04:55 AM
Post #3


D.I.C Head

Group Icon
Joined: 6 Feb, 2008
Posts: 66



Thanked 3 times

Dream Kudos: 25
My Contributions


Thanks. I'm working in VB, C#, and C++. The different syntaxes can get confusing sometimes.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/21/08 07:51PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month