Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Using forbidden functions? #6

Open
migmanu opened this issue Apr 28, 2024 · 0 comments
Open

Using forbidden functions? #6

migmanu opened this issue Apr 28, 2024 · 0 comments

Comments

@migmanu
Copy link

migmanu commented Apr 28, 2024

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;
}
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant