_ [01] >

Quick Review of Structs

In C, a struct is used to group pieces of data into a single entity.

struct DayOfYear { int month; /* 1 = Jan ... 12 = Dec */ int day; };

Dot notation is used to access members:

DayOfYear july4th; july4th.month = 7; july4th.day = 4;

Problem: no data hiding.