C++中struct对C中的struct进行了扩展,基本可以实现class的功能。 (1)struct和class的主要区别在于struct的默认访问控制(包括访问和继承)是public、class的默认访问控制是private。