関数名を印刷して、関数の名前にn個*をプラスしてどうして結果は同じですか?



  :
#include 
void func()
{
int i = 1;
}
int main()
{
printf("%p
",main); printf("%p
",*main); printf("%p
",**main); printf("%p
",***main); printf("%p
",func); printf("%p
",*func); printf("%p
",**func); printf("%p
",***func); return 0; } : eagle@eagle-QJC4:~$ ./a.out 4195652 4195652 4195652 4195652 4195638 4195638 4195638 4195638

次の答えはhttp://blog.chinaunix.net/uid-10314004-id-2964074.html
C言語の関数はfunction-to-pointer方式である、すなわち関数に対してポインタタイプに変換する.
ptrが関数ポインタのタイプである場合、*ptrはそのポインタが指す関数であり、関数自体がポインタに変換するため、*ptrはptrという関数ポインタのタイプに変換されるので、前に何個の*番号があっても、最後にこの関数の呼び出しである.
以下の答えは@fefefe 82からの回答@fefefe 82
C11 draft n1570 6.3.2.1 Lvalues, arrays, and function designators 4 A function designator is an expression that has function type. Except when it is the operand of the sizeof operator, the _Alignof 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’’. 6.5.3.2 Address and indirection operators 4 The unary * operator denotes indirection. If the operand points to a function, the result is a function designator; if it points to an object, the result is an lvalue designating the object. If the operand has type ‘‘pointer to type’’, the result has type ‘‘type’’. If an invalid value has been assigned to the pointer, the behavior of the unary * operator is undefined. function designatorは自動的にpointer to functionに変換され、*を1つ追加してfunction designatorになり、その後pointer to functionに自動的に変換され、何度*を追加しても、最後に手に入れたのはpointer to functionです.