C语言和C++中的struct不大相同,C中的struct不能有函数,而C++的可以有。 在C++中,struct和class的唯一区别就是struct的成员默认为public,而class默认为private。