从下面的代码片段我得到的函数的地址是1.为什么?
#include<iostream>
using namespace std;
int add(int x, int y)
{
int z;
z = x+y;
cout<<"Ans:"<<z<<endl;
}
int main()
{
int a=10, b= 10;
int (*func_ptr) (int,int);
func_ptr = &add;
cout<<"The address of function add()is :"<<func_ptr<<endl;
(*func_ptr) (a,b);
}
Run Code Online (Sandbox Code Playgroud) c++ ×1