From 7e0f021a9aec35fd8e6725e87e3313b101d26f5e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 27 Jan 2008 11:37:44 +0100 Subject: Initial import (2.0.2-6) --- reference/CPLUSPLUS/SYNTAX/struct.html | 102 +++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 reference/CPLUSPLUS/SYNTAX/struct.html (limited to 'reference/CPLUSPLUS/SYNTAX/struct.html') diff --git a/reference/CPLUSPLUS/SYNTAX/struct.html b/reference/CPLUSPLUS/SYNTAX/struct.html new file mode 100644 index 0000000..57df58a --- /dev/null +++ b/reference/CPLUSPLUS/SYNTAX/struct.html @@ -0,0 +1,102 @@ + + +STRUCT keyword + + + + +
+

+
struct keyword in C++
+

+
+ +

+The struct keyword was introduced in 'C', its original functionality +is documented +here. +

+ +C++ has added two new features to structures. +

    +
  1. The syntax has been improved slightly so you no longer have to + mess around with typedef statements. + +

    +

    + + +
    +

    ANSI C approch to structures.

    +
    +
    +
    +    typedef struct Person {int age; char *name} Person_t;   
    +
    +    struct Person FirstMan;
    +    Person_t      SecondMan;
    +    
    +
    +

    + +

    + + +
    +

    C++ structures.

    +
    +
    +
    +    struct Person {int age; char *name};   
    +
    +    Person FirstMan;
    +    Person SecondMan;
    +    
    +
    +

    +

    + +

  2. C++ also took the original idea of structures and added the ability to + associate functions with the data within the structure. This feature + was wrapped up with the introduction of the + class keyword. +
+

+


+

Examples:

+ +Example program. +

+


+

See Also:

+o +C++ Keywords +
+o +C Keywords +

+ +


+

+

+ + + + +
+ Top + + Master Index + + C++ Keywords + + Functions +
+
+

+


+
Martin Leslie +12 Nov 98

+ + + -- cgit v1.2.3-54-g00ecf