passing operator as a parameter
Hi,
I want to have a function that evaluates 2 char vars (like a truth table)
for example:
since
T | F : T
then
Code:
myfunc('t', 'f', ||); /*defined as: bool myfunc(char lv, char rv, ????)*/
should return true;
how can I pass the third parameter? (I know is possible to pass it as a char* but then I will have to have another table to compare operator string and then do the operation which is something I would like to avoid)
Is it possible to pass an operator like ^(XOR) or ||(OR) or &&(AND), etc in a function/method?
Thanks in advance