C++ 默认构造函数
C++中class和struct除了空的默认构造函数,还存在传入初始化列表的默认构造函数。
使用方式为:

struct s { int a,b; double c; } int main() { s s1={1,1,1.1}; }
但是在类内如果提供了构造函数,则不会生成默认构造函数。
C++中class和struct除了空的默认构造函数,还存在传入初始化列表的默认构造函数。
使用方式为:
struct s { int a,b; double c; } int main() { s s1={1,1,1.1}; }
但是在类内如果提供了构造函数,则不会生成默认构造函数。