I'm trying to do a basic C++ score / grade system. I want to validate the users input. If the data is not a number, I want it to display an error message. If it is, I want it to carry on.

However, if the user enters a letter, say for example 'a' or 'A'. It spits out this error : 

```
Debug Assertion Failed!
Program:
...ers\Alex\source\repos\worksheet_1.2a\Debug\worksheet_1.2a.exe
File: minkernel\crts\ucrt\appcrt\convert\isctype.cpp
Line: 36

Expression: c >= -1 && c <= 255

```

This is the code:

```
#include "stdafx.h"
#include <iostream>
#include <cctype>

using namespace std;  

int main()
{
    int score;

    // Recieve user input of score between 0-100. Stores input in score var
    cout << "\nWhat score did you get?\n" << endl;
    cin >> score;

    // Validating input

    if (!isdigit(score)) {
        if (score <= 59)
            cout << "Your grade is F" << endl;
        else if (score > 59 && score < 70)
            cout << "Your grade is D" << endl;
        else if (score > 69 && score < 80)
            cout << "Your grade is C" << endl;
        else if (score > 79 && score < 90)
            cout << "Your grade is B" << endl;
        else if (score > 89)
            cout << "Your grade is A" << endl;
    }
    else {
        cout << "Sorry, that is not a number. Please try again." << endl;
    }

    return 0;
}

```

It works fine if a number is entered, but not at all if a letter is. 

I have looked at several other answers and videos based on 'Debug Assertion Failed' but cannot find one for this particular error. 

Thanks for reading and help given!