Close

Results 1 to 4 of 4
  1. #1
    DF VIP Member Rustyk1's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    151
    Thanks
    0
    Thanked:        0
    Karma Level
    255

    Help Error Handling in C, try() catch()

    My problems:

    1. I know no C or C++

    2. My colleague is abroad with no internet

    3. He is trying to do some error handling using try() and catch(). However, the C compiler says that it doesn't understand the function try(). Does he need to put something in include or something?

    Thank you so much in advance if you can help.

    Cheers

  2. #2
    DF VIP Member hxbro's Avatar
    Join Date
    Nov 2000
    Location
    Behind a wall
    Posts
    2,731
    Thanks
    4
    Thanked:        18
    Karma Level
    476

    Default Re: Error Handling in C, try() catch()

    I maybe wrong but c doesn't support try and catch, only c++ does ?

  3. #3
    DF MaSter Smegma's Avatar
    Join Date
    Jan 2001
    Posts
    57
    Thanks
    0
    Thanked:        0
    Karma Level
    285

    Default Re: Error Handling in C, try() catch()

    the syntax is

    try
    {
    // do something that might cause an exception
    }

    catch(...)
    {
    // catch any exception that was thrown
    }


    But Try, catch is only in c++ although i believe most big (VC++, BCB) will compile it if it's in a c source file.

  4. #4
    DF VIP Member
    RhinoBanga's Avatar
    Join Date
    Nov 2000
    Location
    127.0.0.1
    Posts
    1,780
    Thanks
    20
    Thanked:        13
    Karma Level
    389

    Default Re: Error Handling in C, try() catch()

    Also get him to check that his file extension is .CPP and not .C

    And fyi some C variants do support exception handling, for example MS call it "Structured Exception Handling".

Similar Threads

  1. Read Disc Error
    By fitzy in forum Sony Consoles
    Replies: 3
    Last Post: 3rd October 2002, 08:53 PM
  2. Halo dirty/damaged disc error
    By ohayo in forum Microsoft Consoles
    Replies: 2
    Last Post: 2nd October 2002, 04:28 PM
  3. X-box error codes/sequences
    By toibs in forum Microsoft Consoles
    Replies: 8
    Last Post: 12th September 2002, 12:01 PM
  4. Dirty Disc Error
    By Frontiers83 in forum Microsoft Consoles
    Replies: 1
    Last Post: 7th September 2002, 12:39 AM
  5. GTA3 "Infinite loop" error
    By Mr Tac in forum PC Gaming
    Replies: 2
    Last Post: 6th September 2002, 11:57 AM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •