C Programming Nesting Structures

Last modified by Microchip on 2023/11/09 09:06

Example

1 typedef struct
2{
3  float x;
4  float y;
5 } point;
6
7 typedef struct
8 {
9  point a;
10  point b;
11 } line;
12
13 int main(void)
14 {
15  line m;
16
17  m.a.x = 1.2;
18  m.a.y = 7.6;
19  m.b.x = 38.5;
20  m.b.y = 17.8;
21  ...

Nesting structure diagram