Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

throw exception c++

#include <stdexcept>
#include <limits>
#include <iostream>

using namespace std;

void MyFunc(int c)
{
    if (c > numeric_limits< char> ::max())
        throw invalid_argument("MyFunc argument too large.");
    //...
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #throw #exception
ADD COMMENT
Topic
Name
8+1 =