added macro token-pasting operator example
This commit is contained in:
parent
3c48b1f8c3
commit
bc3132d438
12
macroname.c
Normal file
12
macroname.c
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user