Thursday, January 19, 2006

what is the structure ?

C++ language has extended the C keyword struct to the same functionality of the C++ class keyword except that its members are public by default instead of being private.
Anyway, due to that both class and struct have almost the same functionality in C++, struct is usually used for data-only structures and class for classes that have procedures and member functions.
struct model_name {
type1 element1;
type2 element2;
type3 element3;
.
.
} object_name;

No comments: