How can I cause program to crash and print an error message?
Sep 21, 2019 at 2:26pm
I made a class and I need to be able to crash the program and print an error message if a certain condition is met inside the default constructor.
Something like this inside the default constructor:
1 2 3 4
|
if(condition){
//crash program
//print error message explaining why program crashed
}
|
What would be the most elegant way to do this?
Sep 21, 2019 at 2:47pm
Sep 21, 2019 at 2:54pm
Sep 21, 2019 at 3:01pm
Topic archived. No new replies allowed.