You need to change the declaration of
value
to
char
. That way you can accept either type. Note that your code above will never work since
std::isdigit
tests characters, not integer values. So you need something like:
std::cout << "Enter the values : " << endl;
char value;
cin >> value;
if (std::isdigit(value))
{
matrix[x][y] = value - '0'; }
else
{
matrix[x][y] = 0;
}