I understand the premise behind structures, being that they are a storage area for data but what I'm confused about is how the info is grouped inside of it. I have looked at the tutorial and am a bit confused. Would it be true that when a structure is populated, all info of similar types are grouped together? Ie...ALL "strings" get stored under the string type and ALL INT data get grouped as int?
It is not a storage it is a user defined type. Defining the struct tells the compiler the info. Not sure what you mean groups and populate , where have you heard that ?
Would it be true that when a structure is populated, all info of similar types are grouped together? Ie...ALL "strings" get stored under the string type and ALL INT data get grouped as int?
No, the order of the items is important regarding initialization.
Here size sould be initialized after text, but before size_text. If we change order of members then we will break this dependency chain (for example if we will place size first, it will be initialized first and will try to request size of uninitialized string)
Structure are the very simple concept..It is a collection of different types of variables under a same common name.
There is a main difference between array and structures.Arrays: It is collection of all similar data types under a same common name.
thanks for the help. What I really meant was that a structure can serve as something like a record and after a little more digging, I discovered that what I want to use is an array of structures. I think. Just gotta polish it up a little.