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

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. C Programming Fundamentals

Lesson 18 of 50 · c

Structures (`struct`)

Duration: 10 mins

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.

Previous: Dynamic Memory – malloc & freeNext: Unions