- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 C++ stl container 存放含动态数据自定义类的注意事项(堆已损坏)
Author: YuMaNzIDate: 2015/04/24stl实现的多种容器使用简单,性能良好,能极大提高日常的c++ code开发效率。但我们在用这些容器存储自定义类(而不是简单的int,、double、string等数据类型)时,一定要注意生存空间的问题。下面通过一个例子简单说明:class SimProf{public: SimProf(); ~SimP
2015-04-24 14:48:34 1481
原创 C++调用C函数与Extern "C"
Author: YuMaNzIDate: 2015/04/13---------------------------------------------------------------在实际中,我们可能会遇到开发一个CPP的项目,而某一个模块的功能已经有现有的C实现的库可以使用的情况。在CPP中通过Include头文件+lib或其它的方式调用相应的C函数,在编译时会报lnk2001
2015-04-13 23:30:59 674
原创 Writing Template (April 2015)
YuMaNzI(Paragraphs or sentences below are some writing templates I find useful during each month.)Obviously, these assumptions do not often hold true, and document clustering results could be
2015-04-10 15:03:05 611
原创 Several Topics On C++ fstream
Author: YuMaNzI2014/06/28 1. Running-time Comparison of getline and operator >>To Be Continue.1. Running-time Comparison of getline and operator >>I use fstream to read a graph, which is m
2014-06-28 20:31:41 780
原创 Chap 2 Representing and Manipulating Information (CS:APP)
1. Information Storage1.1 virtual memory: a machine-level program views memory as a ver
2014-06-23 16:13:49 1529 1
原创 _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Exception
Author: YuManZiDate: 2014/06/11void Container::AddConfToTemp(const string & i_title, const int * i_authors, const int & i_authorCount,const int & i_conf, const int & i_year) {Publication pub
2014-06-16 20:07:27 900
原创 Visual Studio error LNK2019: 无法解析的外部符号
Visual Studio开发中引用第三方的库时,可能会遇到Error LNK 2019,这是由于库引用不正确导致的。本文针对引用.h 头文件和.lib库文件遇到error LNK2019 的情况。第一步,添加.h到项目的包含目录。右键点击开发项目->属性->VC++目录->包含目录, 将.h文件所在目录添加到包含目录最后,目录之间用';' 分隔。第二步,添加lib到项
2014-02-09 22:30:36 3891
转载 IO Redirection in C++ (redirect cin/cout to file stream, and restore)
#include #include #include void f(){ std::string line; while(std::getline(std::cin, line)) //input from the file in.txt { std::cout line "\n"; //output to the file out.tx
2014-01-19 15:17:16 1657
原创 两种方法在Visual Studio Win32控制平台程序中使用超过4G的内存
两种方法在Visual Studio Win32控制平台程序中使用超过4G的内存(以Visual Sutdio 2013为例)如果你的程序运行中由于申请大空间而抛出了bad alloc异常,那这篇文章提出的两个方法将对你有些帮助。捕获异常的方法很简单: try { your code...} catch (exception e) {cerr 1: 启用大地址在解决方案资源
2014-01-16 12:34:10 6240 1
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人