Structures in C
📘 C
👁 29 views
📅 Dec 22, 2025
⏱ Estimated reading time: 1 min
A structure is a user-defined data type that allows grouping of different data types under a single name.
Need for Structures
-
Store related data together
-
Represent real-world entities
-
Overcome limitations of arrays
Declaration of Structure
Example Declaration
Declaring Structure Variables
Accessing Structure Members
-
Use dot (
.) operator
Example Program
Array of Structures
Passing Structure to Function
-
Passed by value or reference
Structure Pointer
Access members using -> operator:
Nested Structures
Structure inside another structure.
Advantages of Structures
-
Organizes complex data
-
Improves readability
-
Supports data abstraction
Summary
-
Structures store heterogeneous data
-
Members accessed using dot or arrow operator
-
Can be used with arrays, pointers, and functions
🔒 Some advanced sections are available for Registered Members
Register Now
Register Now
Share this Post
← Back to Tutorials