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: 
Your code will compile and *work*, for some definition of work.

Still you might get unexpected results, because `y` is a `char`, which means its signedness is implementation defined. That combined with unknown size of int will lead to much joy.

Also, please write the char literals you want, don't look at the ASCII table yourself. Any reader (you in 5 minutes) will be thankful.

Last point: Avoid gratuituous cast, they don't make anything better and may hide problems your compiler would normally warn about.
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.