Difference between revisions of "Struct"

From Valve Developer Community
Jump to: navigation, search
(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…')
 
m (linked the german translation)
 
Line 1: Line 1:
 +
{{otherlang2
 +
|de=Struct:de
 +
}}
 
A '''struct''' is identical to a [[:Category:Classes|class]], except that its members are public by default. It exists in C++ largely for the purpose of backwards compatibility with C.
 
A '''struct''' is identical to a [[:Category:Classes|class]], except that its members are public by default. It exists in C++ largely for the purpose of backwards compatibility with C.
  

Latest revision as of 11:49, 26 April 2013

Deutsch

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.