Struct Padding in C: Overview, Examples, Visuals
Published in
7 min readFeb 16, 2023
A struct in C is a composite data type that allows you to group multiple variables together and store them in the same block of memory. If you’re familiar with Java, they’re a little similar to class definitions. In the picture above, a struct is being used to represent a “student” type, that has a name, age, gpa, and is_cs_major boolean value associated with if they are a cs major. Also note that the…