What happens if an exception is thrown but not caught in a C++ program? 

  • The program continues normally. 
  • The program crashes. 
  • The exception is ignored. 
  • The exception is retried.
When an exception is thrown but not caught in a C++ program, it leads to the termination of the program. This is because unhandled exceptions indicate unforeseen errors, and the program cannot predict how to safely continue in such cases.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *