摘要: #include <iostream> using namespace std; class passport { public: passport() //默认构造 { } passport(int id,string tongxingzheng,string mima,string shenfe 阅读全文
posted @ 2020-02-18 10:38 神迹丶 阅读(1356) 评论(0) 推荐(0) 编辑
摘要: 结构体在栈里。而类在堆里。 结构体为值类型。而类是引用类型 结构体不能被继承,而类可以。 结构体无构造函数 类可以定义虚函数,而结构体不行。 结构在数据参数方面效率更高,简单数组的应用中成本很低。而类在方法运算方面更有优势,在抽象多级别时最佳选择 结构体不能重载。而类可以。 阅读全文
posted @ 2020-02-18 09:15 神迹丶 阅读(2018) 评论(1) 推荐(0) 编辑
网站已运行: