9: int *obj = new int(6); 00F714CE push 4 //压栈 00F714D0 call operator new (0F711EAh) //调用new函数返回分配的地址addr --- 0F711EAh是指令 jmp operator new 的地址 00F714D
分类:
编程语言 时间:
2016-02-02 08:36:42
阅读次数:
237
搞了个Maven工程在Eclipse上,刚开始说JDK版本不对,编译的时候老报错误,很容易搞明白, 本地JDK版本为1.7.0_79: diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher
分类:
其他好文 时间:
2016-02-01 20:46:13
阅读次数:
140
forward_list forward_list是C++11版本才有的。forward_list被实现为单链表,而list是一个双向链表,所以forward_list要比list高效一些。forward_list设计的时候就是追求效率的,跟我们自己写的C格式的单链表一样的高效。 考虑到效率问题,f
分类:
其他好文 时间:
2016-02-01 20:37:12
阅读次数:
134
QVector和vector的比较: Qvector默认使用隐式共享,可以用setSharable改变其隐式共享。使用non-const操作和函数将引起深拷贝。at()比operator[](),快,因为它不进行深拷贝.Qvector取值都会检查越界问题。 看看简单的例子: QVector<int>
分类:
其他好文 时间:
2016-02-01 20:35:34
阅读次数:
480
1 struct bigint{ 2 int a[500]; //可表示1000位以内的整数 3 bigint& operator*(int & value){ 4 for(int i=0;i<300;i++) 5 a[i]=a[i]*value; 6 int c=0; 7 for(int i=0;
分类:
其他好文 时间:
2016-01-30 17:58:30
阅读次数:
204
Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 思路: 采用位运算。我们先将两个数都看作是正数。 我们将除数左移一位就是将它
分类:
其他好文 时间:
2016-01-30 13:27:53
阅读次数:
136
异常信息: Undefined symbols for architecture i386: "operator delete[](void*)", referenced from: +[WeChatApiUtil EncodeBase64:] in libWeChatSDK.a(WeChatApi
分类:
微信 时间:
2016-01-27 17:24:52
阅读次数:
580
之前出于好奇想自己实现apply的功能(不使用call,bind),一写才发现用eval无法实现,除非传入的参数全是字符串。今天突然看到这个ES6新特性spread opertor,发现有戏了Function.prototype.apply2 = function(obj, arg) { var ....
分类:
移动开发 时间:
2016-01-25 19:01:10
阅读次数:
133
new:int *a = new int[size];int **a = new int*[size];运算符重载:class Complex{ public: int a,b;};Complex operator+(Complex &x, Complex &y){ // x+y...
分类:
编程语言 时间:
2016-01-24 09:14:47
阅读次数:
169
# Word count on manuscript using PySpark# import regex moduleimport re# import add from operator modulefrom operator import add# read input filefile_i...
分类:
其他好文 时间:
2016-01-21 10:30:13
阅读次数:
633