Is the asterisk optional when calling a function pointer?
问题 I couldn't find an answer to this anywhere. I just read K&R and saw them calling a function pointer like this: (*ptr)(arg1, arg2); I vividly remember, however, to have seen someone using them like this: ptr(arg1, arg2); That might have been in C++, though. How are the rules? Do they differ in C and C++? 回答1: TL;DR The rules in C and C++ are the same, there's no difference between the two. What does the C++ Standard (n3797) say? 5.2.2p1 Function call [expr.call] A function call is a postfix