C/C++
犀利叔蓝波
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
处理new分配内存失败情况
转自:http://www.51testing.com/html/70/n-827070.html在C++语言中,我们经常会使用new给一个对象分配内存空间,而当内存不够会出现内存不足的情况。C++提供了两中报告方式: 1、抛出bad_alloc异常来报告分配失败; 2、返回空指针,而不会抛出异常。 C++为什么会采用这两种方式呢?这主要是由于各大编译器公司设转载 2014-04-16 11:14:21 · 784 阅读 · 0 评论 -
指向指针的指针
写这篇文章,是因为几天前原创 2014-05-18 00:02:29 · 610 阅读 · 0 评论 -
signed unsigned 引发的血案
问题产生于局域网传输一幅图片。服务端是由原创 2014-05-21 10:12:06 · 667 阅读 · 0 评论 -
变长参数处理
有时候,有些函数,参数个数是非固定的,典型的比如printf()。原创 2014-04-21 11:46:43 · 697 阅读 · 0 评论 -
Unicode字符串转UTF-8 (C++)
#include using std::string;using std::wstring;string UnicodeToUTF8( const wstring& str){ char* pElementText; int iTextLen; // wide char to multi char iTextLen = WideCharToMultiByte( C转载 2014-04-02 17:42:47 · 956 阅读 · 0 评论 -
利用流将数字转换为字符串 (C++)
#include #include using std::string;using std::wstring;using std::stringstream;using std::wstringstream;string num2str(int i){ stringstream ss; ss<<i; return ss.str();}wstring num2wstr(转载 2014-04-02 17:38:51 · 814 阅读 · 0 评论 -
std::cin 与 ctrl+z 配合使用时遇到的问题
《C++ Primer》第四版第一章1.4.4节,就早早的教了women原创 2014-07-08 10:25:03 · 1692 阅读 · 1 评论
分享