In C (contrarily to PHP) you know at compile time if a variable is of type char
or int
, so there is no point in having ==
and ===
operators.
I would like something like
compare('a', 97)
Is that a function? If so, the type of the arguments are fixed at compile time, so you couldn't implement that, and anysay it would not make sense to call that function. You know, at compile time, if the arguments are of the same type or not.
Further, if we have
c = (char)40;
i = 40;
what should that compare(c,i)
return?
Perhaps you can give us some motivation, why do you believe you need such a function?
You could write a macro that puts a sizeof()
comparison before the ==
, but, this would not distinguish different types of same size, and, again, it would not really make much sense.