Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Structures (`struct`) | C Programming Fundamentals lesson | BraveProgrammer
  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 18 of 50

·c

Structures (`struct`)

10 mins

Course progress36%

What you'll learn

Keep these ideas in mind as you work through the lesson.

4 points
  • `struct` creates a new type that can hold heterogeneous members.
  • Access members with the `.` operator (`structVar.member`).
  • When you have a `struct *ptr`, use `ptr->member`.
  • `typedef struct {...} Name;` simplifies usage.

struct groups different data types into a single composite type.

struct Point {
    double x;
    double y;
};

struct Point p1 = { .x = 3.0, .y = 4.0 };

You can create typedefs for shorter names and nest structs. Use the . operator to access members, or -> when you have a pointer to a struct.

Make it stickPractice what you've learned1 quiz · 3 practical tests · Optional activities from C Programming FundamentalsBrowse activities
Previous lessonDynamic Memory – malloc & freeContinue to lesson 19UnionsBack to C Programming Fundamentals curriculum