如何聲明宏定義的函數

如何聲明宏定義的函數:

請看下面:

搞定
dd.c 中
#include <stdio.h>


#define CTOR(type)              \
void type##Setting()            \
{                               \
    printf("%s\n","sss");       \
}

CTOR(type);
dd.h 中
#define CTOR(type)  \
void type##Setting();
然後主函數 demo.c中
#include "dd.h"

extern CTOR(type)

int main()
{
   typeSetting();

   return(0);
}

http://bbs.bccn.net/thread-285907-1-1.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章