我有一个字符串数组char version[][8] = {"new", "old", "latest", "oldest", "ancient"}
;
我有一个宏
#define FS(file, attr) \
filesys(file, file_ ##attr## _ops) \
如何将字符串数组的 version
成员传递给 FS 宏?
最佳答案
你不能。宏是编译时间,编译器将无法按照您想要的方式拼接字符串。相反,请尝试使用 strcat()
,只是不要忘记您需要跟踪字符串数组的大小。
关于c - 如何将字符串作为参数传递给 C 宏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56727168/