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.