Logo 
Search:

C Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C ProgrammingRSS Feeds

C programming practical question 167

  Shared By: Adah Miller    Date: Jan 24    Category: C Programming    Views: 63

Answer:

Is the following code legal?

void main()
{
typedef struct a aType;
aType someVariable;
struct a
{
int x;
aType *b;
};
}


Answer:
No


Explanation:
When the declaration,
typedef struct a aType;
is encountered body of struct a is not known. This is known as ‘incomplete types’.

Share: 
 

Didn't find what you were looking for? Find more on C programming practical question 167 Or get search suggestion and latest updates.


Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].


Tagged: