有什么区别:
int (*wskNaF)(int, int) = addition;
和这一行
int (*wskNaF)(int, int) = &addition;
分数完全相同:
#include <cstdio>
int addition( int a, int b );
int (*wskNaF)(int, int) = addition;
//int (*wskNaF)(int, int) = &addition;
int main()
{
printf("Score= %d\n", wskNaF(5,7));
return 0;
}
int addition( int a, int b )
{
return a + b;
}
// g++ test.cpp -o test && ./test
我认为函数名也是她的指针?我错了吗?