Veda Bites are swipeable micro-lessons — each one teaches exactly one
idea. Here's a taste from this kit; the app has the full deck.
💡 Key Idea
Structures: Grouping Different Data Types
One variable, many data types — that's a structure.
A structure in C is a user-defined data type that groups variables of different types under a single name. It's like a record that holds related information together.
↳ Structures let you bundle different data types into one logical unit, making data handling more organized.
💻 Code Example
Defining and Using a Structure
See how a struct is created and used.
The struct defines a template, and `s1` is a variable of that type. Members are accessed with the dot operator (`.`).
↳ Define a struct with `struct` keyword, then create variables and access members using the dot operator.
⚠️ Common Mistake
Forgetting the Semicolon After a Struct
A missing semicolon breaks your whole program.
↳ The semicolon after the struct's closing brace is mandatory — it's part of the declaration.