Answers for "try statement in c++"

C++
6

try statement in c++

try {
	//do
} catch (...){
	//if error do
}
Posted by: Guest on March-02-2020
2

try statement in c++

// exceptions
#include <iostream>
using namespace std;

int main () {
  try
  {
    throw 20;
  }
  catch (int e)
  {
    cout << "An exception occurred. Exception Nr. " << e << '\n';
  }
  return 0;
}
Posted by: Guest on July-13-2020

Browse Popular Code Answers by Language