Classes: Structures
Applies To: C++Builder 1 or higher
Category: C++ Language
- A structure are very similar to a class. The only difference is that all the members are public by default. You can use the private and protected keywords to change this. The general from of structures is:
-
struct structure_name {
protected:
private:
} objects;
|
-
- Here is a simple example:
-
- struct OS {
-
- // Public by default
- int Windows;
- int Linux;
-
- };
C++Builder Developer's Network
Copyright © Yoto Yotov