Structure of header file?

So far we’ve just been adding variables near the end of the file (under the second “public”). There are 3 places in the code that say either “public:” or “private:” and the way it’s structured seems like there’s code grouped under each of those. Am I correct in thinking that everything defined under these public/private keywords belongs to them?

For example, line 16 belongs to the first public while lines 23-32 belong to the second public? If that’s the case, why have not have everything that’s public under a single public keyword?

Hard to tell what you mean by that but there’s no “tiers”, they are either public/protected/private.

Organisation. Say you want to group all of the weapon related members together but want to have different access for some of them.

Thank you that answers it!

FYI for anyone in the future with the same question, Sam covers this in the “Member Functions” lecture a few lectures from now.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms