Monday 1 April 2013

Is the following code legal? (4)


    Is the following code legal?

typedef struct a aType;
struct a
{
int x;
aType *b;
};
Answer:
    Yes
Explanation:
The typename aType is known at the point of declaring the structure, because it is already typedefined.

Blog Author: Vijay Kumar

No comments:

Post a Comment