• Advertisement

Archived

This topic is now archived and is closed to further replies.

exception handling

This topic is 5156 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would like some personal opinions here on exception handling. Is it better to use __try __except blocks or try catch blocks? And why is it better to use them over the others? Or is it better to use a combination? Just lookin for a little advice here ---- Mike Portfolio: Http://members.iinet.net.au/~slyons Team AI: Http://members.iinet.net.au/~slyons/teamai

Share this post


Link to post
Share on other sites
Advertisement
Don''t use __try __except blocks unless you know you *need* them, and *why* you need them as they are not part of the C++ language.


“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
— Brian W. Kernighan (C programming language co-inventor)

Share this post


Link to post
Share on other sites
Use try and catch until you find that they don''t do the job, then come back here and (providing some context) ask if __try __except would solve the problem.

Share this post


Link to post
Share on other sites
__try and __except (and __finally) are an extension to c in microsofts compiler, not? should be used if you need exceptionhandling in c, but in c++, you should not have any need..

i think..

its long time i coded in a visual studio, or in c/c++




If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net

Share this post


Link to post
Share on other sites
quote:
Original post by Zahlman
Use try and catch until you find that they don''t do the job, then come back here and (providing some context) ask if __try __except would solve the problem.


Lol, nice one

Would a first chance exception be one of those that would need a __try __except?


----
Mike
Portfolio: Http://members.iinet.net.au/~slyons
Team AI: Http://members.iinet.net.au/~slyons/teamai

Share this post


Link to post
Share on other sites

  • Advertisement