Does this line
char chValue = max('a', '6'); // returns 'a'
int max(int nX, int nY)
{
return (nX > nY) ? nX : nY;
}
cast the letter 'a'
to its ASCII equivalent number then compare it to the integer?
Yes, because max
is a function that takes two int
s as arguments, the char a
will get implicitly converted into an int
and then get passed as an argument of the function.