举例,假设函数是 bool compareIsbn(const string &s1,const string &s2);
那么如何获取指向这个函数指针的类型?我们在map中要用到这个类型,所以我们简单介绍下:
typedef bool (*pf)(const string &s1,const string &s2);
注意:(1)名字pf 一定要位于*之后
(2)定义时候不用函数名字,pf是类型名
举例,假设函数是 bool compareIsbn(const string &s1,const string &s2);
那么如何获取指向这个函数指针的类型?我们在map中要用到这个类型,所以我们简单介绍下:
typedef bool (*pf)(const string &s1,const string &s2);
注意:(1)名字pf 一定要位于*之后
(2)定义时候不用函数名字,pf是类型名