struct remains in C++ because C++ is designed to be compatible to C which has struct.
In C++ struct is converted to class in compiling time.
It is interesting to look at the history of programming languages:
1. early Fortran has only arries which are used only for the same type of variables(like double, float, int).
2. struct was introduced in C in order to put different data types in one structure. For example:
struct A
{
double a;
int b;
float c;
}
3. functions were added to struct==>class in C++
Looks like small changes. However, they brought revolutions to software design.
[ 此帖被steinlee在2010-03-04 12:35重新编辑 ]