用于在C中创建变量的宏
发布时间:2020-12-16 10:23:33 所属栏目:百科 来源:网络整理
导读:我想创建几个形式的变量: static char fooObjectKey;static char bazObjectKey;static char wthObjectKey;static char myObjectObjectKey;... 所以我写了 #define defineVar(x) static char #x ObjectKeydefineVar(foo);defineVar(baz);defineVar(wth);defi
我想创建几个形式的变量:
static char fooObjectKey; static char bazObjectKey; static char wthObjectKey; static char myObjectObjectKey; ... 所以我写了 #define defineVar(x) static char #x ObjectKey defineVar(foo); defineVar(baz); defineVar(wth); defineVar(myObject); 但我收到错误:预期的标识符或} 我在这做错了什么? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |