#include<stdio.h>
#define A(int x) printf("%d\n",x)
#define AS(A) A(20)
typedef struct{
int *m;
int n;
int k;
}st;
//static st sb[10] = {AS(A)}
int main()
{
AS(A);
return 0;
}
I’m getting an error as below .
Line 14: error: macro parameters must be comma-separated
Please help.
This has nothing to do with nesting macros. The problem is
you must remove the
intpart. Like this:If you leave the
int, the preprocessor interprets it as another parameter, that’s why it tells youbecause expects: