Struct: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{lang|Struct}}
{{lowercase}}
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.


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.
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.
==See also==
{{w|struct (C programming language)}}


[[Category:Programming]]
[[Category:Programming]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 17:06, 1 October 2023

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.

See also

Wikipedia icon struct (C programming language)