0Pricing
C Academy · Lesson

Defining and Using Structures

Learn how to group related variables into a structure and use struct in real-world applications.

1

Defining and Using Structures

Structures (struct) allow us to group related variables under a single name.

In this lesson, you will learn:

  • How to define and use structures.
  • How to access structure members.
  • How to pass structures to functions.
Defining and Using Structures — illustration 1

2

What is a Structure?

A structure is a user-defined data type that groups different variables.

Example structure definition:

struct Person { char name[50]; int age; float height; };

Here, a Person structure stores name, age, and height.

All lessons in this course

  1. Defining and Using Structures
  2. Unions and Memory Efficiency
  3. Enumerations (enum)
← Back to C Academy