Struct

From Valve Developer Community
Revision as of 14:23, 17 August 2009 by TomEdwards (talk | contribs) (Created page with 'A '''struct''' is identical to a class, except that its members are public by default. It exists in C++ largely for the purpose of backwards compatibility w…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A struct is identical to a class, except that its members are public by default. It exists in C++ largely for the purpose of backwards compatibility with C.

Valve typically use structs to pass conceptual groups of variables between functions. This is advantageous because a struct (or a indeed class - there is little between the two) can be extended or modified later without breaking the existing calls or declarations of any code that uses it.