Struct (computer science)

GPTKB entity

Statements (52)
Predicate Object
gptkbp:instanceOf Data structure
gptkbp:canBe gptkb:Anonymous
Nested
Aligned
Named
Packed
Representing complex numbers
Representing geometric points
Representing graphs
Representing linked list nodes
Representing records in databases
Representing trees
Self-referential
gptkbp:contrastsWith gptkb:Class_(computer_science)
gptkbp:definedIn struct keyword
gptkbp:example struct Point { int x; int y; }
gptkbp:hasFeature Can be nested
Can be passed by value or reference
Can contain fields of different data types
Fields are called members
Fields can be accessed via dot notation
gptkbp:hasField Member variable
gptkbp:hasSyntax struct Name { type field1; type field2; }
https://www.w3.org/2000/01/rdf-schema#label Struct (computer science)
gptkbp:limitation Limited encapsulation
No inheritance in C structs
No methods in C structs
No polymorphism
gptkbp:originatedIn gptkb:C_programming_language
gptkbp:purpose Group variables under one name
Model complex data
Represent records
gptkbp:relatedTo gptkb:Union_(computer_science)
gptkb:Class_(computer_science)
gptkb:Object_(computer_science)
gptkb:Record_(computer_science)
gptkb:Tuple_(computer_science)
gptkbp:standardizedBy gptkb:ANSI_C
gptkb:ISO_C
gptkbp:usedIn gptkb:Rust_programming_language
gptkb:C_programming_language
gptkb:C#_programming_language
gptkb:Objective-C_programming_language
gptkb:D_programming_language
gptkb:Go_programming_language
gptkb:C++_programming_language
gptkb:Fortran_programming_language
gptkb:Ada_programming_language
gptkb:Pascal_programming_language
gptkb:Swift_programming_language
gptkbp:bfsParent gptkb:Union_(computer_science)
gptkbp:bfsLayer 6