CPP_Modules icon indicating copy to clipboard operation
CPP_Modules copied to clipboard

Using forbidden functions?

Open migmanu opened this issue 2 months ago • 0 comments

Hey! I was checking your answers and noticed that you are using stoi, stof and stood in module 06. As explained here, those are C++11 functions.

Did you get an exception from your School or is there a loophole in the rules?

bool    Converter::isImpossible( void ) {
    try
    {
        if ( _type == INT ) {
            _n = std::stoi( _str );
        } else if ( _type == FLOAT ) {
            _f = std::stof( _str );
        } else if ( _type == DOUBLE ) {
            _d = std::stod( _str );
        }
    }
    catch ( std::exception& e )
    {
        _impossible = true;
        return true;
    }
    return false;
}

migmanu avatar Apr 28 '24 11:04 migmanu