| <<< Enumerations | Index | Using existing classes >>> |
Keywords struct and class
struct Point { int x; int y; };
-or-
class Point {
public:
int x;
int y;
};
Point p1; // Note: struct keyword not needed
p1.x = 9;
p1.x = 2;
C supports structs. In C++ structs and classes can also have functions.
| <<< Enumerations | Index | Using existing classes >>> |