Skip to content

Latest commit

 

History

History
14 lines (7 loc) · 601 Bytes

File metadata and controls

14 lines (7 loc) · 601 Bytes

Structs

Why Structures?

We've seen lots of examples so far of where we would want to store multiple pieces of information. Up until now we've always used an array, however the main drawback of using an array is that it can only store one type of information, like an array of ints or an array of chars. The main advantage of using a struct is that it allows you to use different types of data.

Convention

The convention in C is to create your structs in a seperate header .h file.

The dot operator

The dot operator is used to assess specific members (elements) of a struct.