2、填充結構#define FILL(a) {a, #a}enum IDD{OPEN, CLOSE};typedef struct MSG{IDD id;const char * msg;}MSG;MSG _msg[] = {FILL(OPEN), FILL(CLOSE)};相當於:MSG _msg[] = {{OPEN, "OPEN"},{CLOSE, "CLOSE"}};
http://stenlyho.blogspot.com/2007/04/c_04.html
張貼留言
沒有留言:
張貼留言