try catch or if c++ code example Example: try statement in c++ try { //do } catch (...){ //if error do }