twitter
    Find out what I'm doing, Follow Me :)

More About Structures

It is possible to continue nesting structures until you get totally confused. If you define them properly, the computer will not get confused because there is no stated limit as to how many levels of nesting are allowed. There is probably a practical limit of three beyond which you will get confused, but the language has no limit. In addition to nesting, you can include as many structures as you desire in any level of structures, such as defining another structure prior to "alldat" and using it in "alldat" in addition to using "person". The structure named "person" could be included in "alldat" two or more times if desired, as could pointers to it.

Structures can contain arrays of other structures which in turn can contain arrays of simple types or other structures. It can go on and on until you lose all reason to continue. I am only trying to illustrate to you that structures are very valuable and you will find them great aids to programming if you use them wisely. Be conservative at first, and get bolder as you gain experience. More complex structures will not be illustrated here, but you will find examples of additional structures in the example programs included in the last chapter of this tutorial.

For example, see the "#include" file "STRUCT.H".