MIPI_BaseC_WebinarFRTK/25_Seminar12/06_macros_aname_p17.c
2024-11-13 09:22:28 +03:00

21 lines
344 B
C

#include <stdio.h>
#define ANAME(n) a##n
#define MERGE(a,b) a##b
#define PRINT_AN(n) printf("a" #n " = %d\n", a ## n);
int main(void)
{
int ANAME(1) = 10;
int ANAME(2) = 22;
int ANAME(3) = 35;
PRINT_AN(1);
PRINT_AN(2);
PRINT_AN(3);
int ai=3;
PRINT_AN(i);//ai
MERGE(a1+,+);
PRINT_AN(1);
return 0;
}