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