星期五, 10月 23, 2020

struct enum

 

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

星期四, 10月 22, 2020

utf-8 en/decode ascii 88591 88599

 https://github.com/haipome/utf8


https://en.wikipedia.org/wiki/ISO/IEC_8859-9