0

This doesn't seem to behave as I would expect (as it does in matlab, for example). I want to execute a command, but give some readable output instead of the often very messy auto-generated error (index out of range or something).

try
{
  MyFunction(1,2);
}
catch(char* str)
{
  cout << "There was a problem." << endl;
}

Is that now how you do this in c++?

Thanks,

Dave

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by daviddoria
0

ah - i see, i wasn't throwing anything, so clearly it was not being caught! Thanks for the link.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.