I l @ ve RuBoard |
In C++ a structure is just like a class, except that all the data fields and member functions are public. For example, the following two are the same:
As you can see, a structure is merely a class with all the protections removed. This means that in most cases a class is superior to a structure. In actual practice, most programmers use structures for data only. You'll hardly ever see a structure with member functions. |
I l @ ve RuBoard |