N
new
Hi all,
I have the program as below:
----------------------
#include<stdio.h>
#define FF(x,b) { \
struct ret *t; \
t->##x = b; \
}
struct ret {
int *a;
};
int main()
{
int y =10,*g;
struct ret *s;
g =&y;
FF(a,g);
printf("val:%x %x\n",s->a,g);
return 0;
}
----------------
When I compile the get the below error:
field.c:17:1: pasting "->" and "a" does not give a valid preprocessing
token
Can anyone please help in finding the cause of this error?
I'm using gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
Thanks in adv.
I have the program as below:
----------------------
#include<stdio.h>
#define FF(x,b) { \
struct ret *t; \
t->##x = b; \
}
struct ret {
int *a;
};
int main()
{
int y =10,*g;
struct ret *s;
g =&y;
FF(a,g);
printf("val:%x %x\n",s->a,g);
return 0;
}
----------------
When I compile the get the below error:
field.c:17:1: pasting "->" and "a" does not give a valid preprocessing
token
Can anyone please help in finding the cause of this error?
I'm using gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
Thanks in adv.