c# - Is there a variable type for comparators? -
is there variable type (something string
, int
, or bool
) comparators? (==
, !=
, <=
, >=
, >
, <
) , if not, how c# use them?
i can use
int integervariable = 0;
but there can use do
comp comparatorvariable = ==;
?
the various operators you've listed not have type no. objects have types. you've listed operators, not objects, , have no type. if you're interested in how c# language uses operators, can @ language spec; section 7.3 of c# 5.0 specs titled "operators" , filled information on how c# handles operators.
Comments
Post a Comment