Answers for "throws exception c++"

C++
5

c++ throw exception

#include <stdexcept>

int compare( int a, int b ) {
    if ( a < 0 || b < 0 ) {
        throw std::invalid_argument( "received negative value" );
    }
}
Posted by: Guest on May-01-2020

Code answers related to "throws exception c++"

Browse Popular Code Answers by Language