Marco-Stringification Posted on 2025-11-08 Edited on 2026-01-24 In uncategorized 12345678910#define xstr(s) str(s)#define str(s) #s#define foo 4 str (foo) ==> "foo" xstr (foo) ==> xstr (4) ==> str (4) ==> "4" str() 會將參數直接字串化,不做展開。對 xstr(s) 會先展開 s,因此 str() 拿到的是已展開的參數。 Ref: 3.4 Stringification