A question I got on my last interview:
Design a function f, such that: f(f(n)) == -n Where n<
Design a function f, such that:
f
f(f(n)) == -n
Where n<
n<
Or, you could abuse the preprocessor:
#define f(n) (f##n) #define ff(n) -n int main() { int n = -42; cout << "f(f(" << n << ")) = " << f(f(n)) << endl; }