#include <iostream> #define JMETHOD(type,methodname,arglist) type (*methodname) arglist JMETHOD(int, test_func, (int a, int b)); int add(int a, int b) { return a + b; } int main() { test_func = add; std::cout << test_func(10, 20) << std::endl;; getchar(); return 0; }
#include <iostream> #define JMETHOD(type,methodname,arglist) type (*methodname) arglist int add(int a, int b) { return a + b; } int main() { JMETHOD(int, test_func, (int a, int b)); test_func = add; std::cout << test_func(10, 20) << std::endl;; getchar(); return 0; }
标签:methodname,JMETHOD,int,add,func,test From: https://www.cnblogs.com/leochan007/p/16795116.html