06 2022 档案

摘要:#include <iostream> class Person { public: Person(int age): m_age(age) { } ~Person() { } void func() { std::cout << "Person func" << std::endl; } void 阅读全文
posted @ 2022-06-30 21:38 thomas_blog 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: Person() { std::cout << "Person" << std::endl; } ~Person() { std::cout << "~Person" << std::endl; } private 阅读全文
posted @ 2022-06-30 21:15 thomas_blog 阅读(17) 评论(0) 推荐(0) 编辑
摘要:class Person { private: int age; char sex; }; class Student: public Person { private: int cid; }; > cl /d1 reportSingleClassLayoutStudent D:\ConsoleAp 阅读全文
posted @ 2022-06-30 14:27 thomas_blog 阅读(9) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Add { public: int operator()(int a, int b) { std::cout << "operator()" << std::endl; return a + b; } }; int main() { using n 阅读全文
posted @ 2022-06-29 12:00 thomas_blog 阅读(20) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: Person(std::string name, int age): m_age(age), m_name(name) { } bool operator==(Person &person) { std::cout 阅读全文
posted @ 2022-06-27 18:22 thomas_blog 阅读(18) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: Person() { m_age = NULL; } Person(int age) { std::cout << "Person " << this << std::endl; m_age = new(int); 阅读全文
posted @ 2022-06-27 13:29 thomas_blog 阅读(22) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: void age_set(int age) { m_age = age; } int age_get() { return m_age; } /* 前置++ */ Person &operator++() { ++ 阅读全文
posted @ 2022-06-13 18:06 thomas_blog 阅读(30) 评论(1) 推荐(1) 编辑
摘要:class Person { friend std::ostream &operator<<(std::ostream &out, Person &person); public: void name_set(const std::string &name) { m_name = name; } v 阅读全文
posted @ 2022-06-13 17:33 thomas_blog 阅读(32) 评论(0) 推荐(0) 编辑
摘要:#include <iostream> class Person { public: int age_get() { return m_age; } void age_set(int age) { m_age = age; } Person operator+(Person &person) { P 阅读全文
posted @ 2022-06-10 21:38 thomas_blog 阅读(21) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示