剑指offer
来源:互联网 发布:mac os没有刷新 编辑:程序博客网 时间:2024/06/05 12:03
1.赋值函数
CMyString& CMyString::operator = (const CMyString& str){ if(this != &str){ CMyString strtemp=CMyString(str); char * ptemp=strtemp.m_pData; strtemp.m_pData=m_pData; m_pData=ptemp; } return *this;}
2.单例模式 singleton
http://www.2cto.com/kf/201606/520104.html
//Singleton.hclass Singleton {public: static Singleton* GetInstance();private: Singleton() {} static Singleton *singleton;};//Singleton.cppSingleton* Singleton::singleton = NULL;Singleton* Singleton::GetInstance(){ if(singleton == NULL) singleton = new Singleton(); return singleton;}
0 0
- 剑指OFFER
- 剑指offer
- 剑指Offer
- 剑指offer
- 剑指Offer
- 剑指offer
- 剑指offer
- 剑指offer
- 剑指Offer
- 剑指offer
- 剑指offer
- 剑指Offer
- 剑指offer
- 剑指offer
- 《剑指offer》
- 剑指Offer
- 剑指offer
- 剑指offer
- 解决ScrollView嵌套RecyclerView只显示一行的一种比较简单的方法
- [二]RabbitMQ-客户端源码之AMQConnection
- 使用Java实现面向对象编程-->File/O
- view 状态检查
- Android AMS原理分析(2)
- 剑指offer
- 新路程------imx6 lvds ioctl
- 点击PopupWindow 关闭软键盘
- 面试真题|strong、em等标签的区别
- 常见异常
- 没有谁的幸福值得你去羡慕
- VS2015添加MSDN
- java static使用
- Java 对象属性加载过程