CppCheck是一个C/C++代码缺陷静态检查工具。不同于C/C++编译器及其它分析工具,CppCheck只检查编译器检查不出来的bug,不检查语法错误。所谓静态代码检查就是使用一个工具检查我们写的代码是否安全和健壮,是否有隐藏的问题。 比如无意间写了这样的代码: [cpp] view plain Read More
posted @ 2016-02-12 21:50
findumars
Views(4185)
Comments(0)
Diggs(0)
在main函数之前跑代码的方法 方法: 手工找到程序入口点, 替换为我们自己的函数 [cpp] view plain copy 写测试程序 // test.cpp : Defines the entry point for the console application. // #include " Read More
posted @ 2016-02-12 21:31
findumars
Views(632)
Comments(0)
Diggs(0)
[cpp] view plain copy // test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <windows.h> #include <crtdbg. Read More
posted @ 2016-02-12 21:28
findumars
Views(678)
Comments(0)
Diggs(0)
实验原因 说明如何使用const描述保护类数据不会意外修改. 编译环境 vc6sp6 + win7x64 工程下载 copyConstruction_constMemberFunction.zip 使用非const成员函数,引起的拷贝构造函数报错 [cpp] view plain copy clas Read More
posted @ 2016-02-12 21:27
findumars
Views(769)
Comments(0)
Diggs(0)
[cpp] view plain copy #include <iostream> #include <limits> using namespace std; #define SAFE_DELETE(x) \ { \ if (NULL != (x)) \ { \ delete (x); \ (x) Read More
posted @ 2016-02-12 21:25
findumars
Views(1548)
Comments(0)
Diggs(0)