首页 > 其他分享 >JMETHOD

JMETHOD

时间:2022-10-15 21:45:52浏览次数:32  
标签:methodname JMETHOD int add func test

#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

相关文章