#include <stdio.h>
#define LINE_FILE(x,y) "Line " #y " of file" x
#define _LINE_FILE_(x,y) LINE_FILE(x , y)
#define __LINE_FILE__ _LINE_FILE_( __FILE__ , __LINE__ )
#define MyMacro(a,b,c) a##b##c
int main (
)
{
const char *pwsz = __LINE_FILE__;
const char *MyMacro(A,B,c) = "good";
printf("%s\n",pwsz);
printf("%s\n",MyMacro(A,B,c));
return 0;
}
參考資料:
EFI v.s #define
#define連接字串和數字 『轉錄』
沒有留言:
張貼留言