• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 225
  • Last Modified:

some general questions from a vb guy!!!

Two questions.

1. Visual Basic has a feature called On Error Resume Next and On Error GoTo TrapError, which allows you to trap error and/or avoid them. Is there a similar way of doing this is C++? Everytime I run into an error, I have to reboot my computer.

2. VB also has a feature which allows you to exit a function from within a function. It's something like "Exit Sub". How do I do this in C++. Do I use Break?

Thanks.
0
hobster
Asked:
hobster
1 Solution
 
jkrCommented:
1. For something like 'On Error goto' use C++ TRY/CATCH statements

2. No, 'break' can only be used in loops and 'sitch' statements, simply use 'return( <returntype>)
0
 
pagladasuCommented:
1. try, catch, and throw for errors.
2. equivalent of EXIT SUB is the return statement.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now