随笔分类 -  C++primer

开始C++进阶之路!!!
摘要:#浅拷贝与深拷贝 //浅拷贝与深拷贝 //#include using namespace std; // class Person { public: Person() { cout << "默认构造函数" << endl; } Person(const Person& p) { m_Age = 阅读全文
posted @ 2023-04-21 00:54 .Shawn 阅读(34) 评论(0) 推荐(0)
摘要:指针 一、认识指针 例如:int* p; 其中p为int类型,即整数指针类型 例如: int i=20; intp; p=i;//error:不能把int赋值给int*。 p=&i//true 此时p为指针 std::cout<< *p <<std::endl;//此时的 *p为 i 值 二、con 阅读全文
posted @ 2022-11-26 13:10 .Shawn 阅读(84) 评论(0) 推荐(0)
摘要:666! 阅读全文
posted @ 2022-11-25 11:34 .Shawn 阅读(15) 评论(0) 推荐(0)