Interview Question

What is structure?

A structure groups separately stored named members.

💡 Concept ✅ Quick Revision ⚙ C

Answer

A structure is an aggregate type whose named members are stored as one object. • Different members can have different types. • Each member has its own storage, subject to padding and alignment. • The dot and arrow operators access structure members.

💡 C Example

struct Point { int x; int y; }; struct Point point = { .x = 2, .y = 3 };

⚡ Quick Revision

A structure groups separately stored named members.