In the following C++ code:
typedef void (*FuncPtr)(void); // FuncPtr typedef
void foo(void){...} // some function
void bar(FuncPtr ptr){...} // take FuncPtr type as an argument
void main(void)
{
bar(FuncPtr(foo)); // where bar is used
}
What does FuncPtr(foo) mean in calling bar?
Is this a way just to cast foo to FuncPtr type? But why not use (FuncPtr)foo?
And is this a feature only in C++, or both in C?