1 class是引用类型,struct是值类型。
2 默认访问权限不同,class默认是private的,struct默认是public的。
3 struct中变量不可以赋初始值,class中的变量可以有初始化的值。
4 class 可以有明显的无参数构造器,但是struct不可以。
5 class使用前必须new关键字实例化,struct不需要。
6 class支持继承和多态,struct不支持. 注意:但是struct 可以和类一样实现接口。
7 class的构造器不需要初始化全部字段,struct的构造器必须初始化所有字段。
1、Constructor/Destructor allowed in class/struct only
2、Declaring a new struct type is simple.
3、These are changes in struct cfs_rq.
4、Listing 1. Important fields from struct key.
5、Unlike the struct dirent that readdir() returns, struct stat has quite a few standard, required members
6、class contradiction and non-class contradiction
7、A rd class is a tourist class.
8、First- rate( class)( second, third class) goods
9、first class quality and first class service
10、Welcome to English class.