added macro token-pasting operator example

This commit is contained in:
Richard Thier 2025-04-24 20:03:39 +02:00
parent 3c48b1f8c3
commit bc3132d438

12
macroname.c Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
/* 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;
}