How to correctly use try catch in integer overflow?

后端 未结 0 757
灰色年华
灰色年华 2021-02-12 14:28
int Product(int x, int y){
   try{
      num = x * y;
    }catch(std::overflow_error and e){}
   return num;
}

//I am new to try catch and would like to

相关标签:
回答
  • 消灭零回复
提交回复
热议问题