-4

How can I make the program continue its execution even if it crashes(Throws an exception).My current program works just fine if I manually press continue after the execution is thrown,so I want to make it continue the execution each time an exception is thrown.

Cata
  • 101
  • 1
  • 12

1 Answers1

3

Use the try-catch statement.

try
    {
      // Your code. 
    }
    catch (Exception e)
    {
       // Handle the exception as you want or need.
    }

More information

https://msdn.microsoft.com/en-us/library/0yd65esw(v=vs.120).aspx

Evan
  • 115
  • 1
  • 11