![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
拖后腿选手
不积硅步,无以至千里;
不积小流,无以成江海
展开
-
调试经验总结-VC下的错误对话框
原文链接:http://www.cppblog.com/kevinlynx/archive/2008/04/24/47998.html 很早前就想写点总结将编程中遇到的各种错误刨根挖底地罗列出来。但是因为这些错误(VC中开调试器遇到的各种错误对话框)都是随机性的,真正想总结的时候又不想不起来有哪些错误。恰好最近运气比较背,各种错误都被我遇遍了,于是恰好有机会做个总结。 这里所说的VC下的转载 2012-03-06 09:34:13 · 571 阅读 · 0 评论 -
温习一下stl的traits技法
//五种迭代器类型 struct input_iterator_tag{}; struct output_iterator_tag{}; struct forward_iterator_tag:public input_iterator_tag{}; struct bidirectional_iterator_tag:public forward_iterator_tag{}; struct ra原创 2015-03-05 15:18:37 · 496 阅读 · 0 评论 -
std::upper_bound & lower_bound & equal_range
#include #include #include #include using namespace std; const int SIZE = 10; void main() { int a1[]={2,2,4,4,4,6,6,6,6,8}; std::vector v(a1,a1+SIZE); std::ostream_iterator outpu原创 2013-12-26 11:25:08 · 1814 阅读 · 0 评论 -
[C++]VS2008使用命令行选项查看对象的内存布局
微软的Visual Studio 2008(VS2008)提供了一个新的选项,给用户显示C++对象在内存中的布局。 这个选项就是/d1reportSingleClassLayout。 具体使用方法如下,在写好相应的cpp文件之后,需要启动VS2008的命令行工具“Visual Studio 2008 Command Prompt”,切换到cpp文件所在目录之后,输入如下的命令: cl [转载 2012-08-01 13:20:47 · 1054 阅读 · 0 评论 -
不用除法运算,实现A/3
方法题集: 方法一. int n=0; while(n>=3) { A-=3; n++; } 方法二. A/3 = A/2 - A/6 A/6 = A/4 - A/12 A/12 = A/8 - A/24 so: A/3 = A/2-(A/4-(A/8-(A/16-(A/14..... 公式没法打,A/3=累加(-1)k次方* A/(2的K次方) 即: N是个值较大的转载 2012-05-07 10:30:09 · 1419 阅读 · 0 评论 -
test dword ptr [eax],eax ; probe page.
局部数组变量定义超过所分配的最大空间 ----------------------------------- Posts Tagged 变量 局部数组变量定义所分配的最大空间为多少?如何设置大小 有两个程序 A: #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { int nArray[25600转载 2012-03-14 17:31:42 · 3192 阅读 · 0 评论 -
c++构造函数必须用到初始化成员列表的四种情况
必须用到初始化成员列表的四种情况: 1) 初始化一个reference成员 2) 初始化一个const成员 3) 调用一个基类的构造函数,而该函数有一组参数 4) 调用一个数据成员对象的构造函数,而该函数有一组参数 摘自《C++对象模型》 下面的例子讲的就是调用基类的构造函数,而该函数有一组参数 #include using namespace std转载 2015-03-05 15:27:48 · 1307 阅读 · 0 评论