From bc3132d438a39e5ebb5cd17de207bdf6b896458d Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Thu, 24 Apr 2025 20:03:39 +0200 Subject: [PATCH] added macro token-pasting operator example --- macroname.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 macroname.c diff --git a/macroname.c b/macroname.c new file mode 100644 index 0000000..ebfa9de --- /dev/null +++ b/macroname.c @@ -0,0 +1,12 @@ +#include +/* Macro token-pasting operator example */ + +#define M(NAME) \ + int NAME##_int; + +int main() { + M(alma); + alma_int = 42; + printf("%d\n", alma_int); + return 0; +}