In code walk-through into some others code I found *
What is this ?
here is the same prototype of that code and it’s not giving any error.
Only warning comes with gcc 4.5.2 But on windows it’s not giving warning and compiles properly. I can’t provide actual code due to IP of the company but I wanted to know this how and why this is correct?
#include<stdio.h>
typedef enum e
{
a,
b,
c
}x,*y;
int main()
{
x t=4;
printf("x : %d\n",t);
y m=5;
printf("*y : %d\n",m);
return 0;
}
It is equivalent to :
So
yis an alias ofenum e *, iey mdeclaresmas pointer toenum e. The following code works indeed as expected: