Why is this thing allowed both in C and C++?
I can't speak for C++, but for C at least a function designator is converted to a pointer:
6.3.2.1 - 4
A function designator is an expression that has function type. Except
when it is the operand of the sizeof operator or the unary & operator,
a function designator with type ‘‘function returning type’’ is
converted to an expression that has type ‘‘pointer to function
returning type’’.
Applying the indirection operator yields a function designator:
6.5.3.2 - 3
The unary * operator denotes indirection. If the operand points to a
function, the result is a function designator
So no matter how many times you apply the indirection operator you'll get the same thing: a function designator that's immediately converted to a pointer.
In my opinion there's little or no use in doing this.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…