So lets say I have 2 functions to choose from based on whether number is even or odd. I came up with this:
(void (*[])()){f1 ,f2}[n%2]();.
(void (*[])()){f1 ,f2}[n%2]();
Is it more or less efficient than simply:
n%2 ? f2() : f1();
没有评论:
发表评论