Question: in c++, is it okay to compare an int to a char because of implicit type casting? Or am I misunderstanding the concept?

For example, can I do 

```
int x = 68;
char y;
std::cin >> y;
//Assuming that the user inputs 'Z';
if(x < y) 
{
 cout << "Your input is larger than x";
}

```

Or do we need to first convert it to an int?

so 

```
 if(x < static_cast<int>(y)) 
{
 cout << "Your input is larger than x";
}

```

Answer: 
Yes you can compare an `int` to some `char`, like you can compare an `int` to some `short`, but it might be considered bad style. I would code

```
if (x < (int)y) 

```

or like you did

```
if (x < static_cast<int>(y))

```

which I find a bit too verbose for that case....

BTW, if you intend to use bytes not as `char` consider also the `int8_t` type (etc...) from `<cstdint>`

Don't forget that on some systems, `char` are `signed` by default, on others they are `unsigned` (and you could explicit `unsigned char` vs `signed char`).
The code you suggest will compile, but I strongly recommend the `static_cast` version. Using `static_cast` you will help the reader understand what do you compare to an integer.