Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Language%20in%20C%20Interview%20Questions%20and%20Answers

Question: What's the difference between these two declarations?

struct str1 { ... } ;
typedef struct { ... } str2 ;
Answer: The first form declares a structure tag whereas the second declares a typedef. The main difference is that the second declaration is of a slightly more abstract type -- its users don't necessarily know that it is a structure, and the keyword struct is not used when declaring instances of it.
Is it helpful? Yes No

Most helpful rated by users:

©2024 WithoutBook