码迷,mamicode.com
首页 >  
搜索关键字:operator-    ( 3564个结果
POJ 1018 离散最优化枚举
#include #include #include #include #include #include #include #include #include #include #define INF 100000000 using namespace std; struct node{ int b,p; bool operator <(const node& a)con...
分类:其他好文   时间:2015-05-05 09:00:49    阅读次数:132
C++ STL中的哈希表 hash_map
在定义hash_map容器的时候,不仅需要指定键和值的类型,还需要指定hash函数和相等函数 (一)hash_map 的hash函数 hash到底是什么样子?看看源码: struct hashint> { size_t operator()(int __x) const { return __x; } }; 原来是个函数对象。在SGI S...
分类:编程语言   时间:2015-05-05 08:55:34    阅读次数:313
POJ 1083 贪心 及其证明
#include #include #include #include #include #include #include #include #include #include #include #define INF 100000000 using namespace std; struct node{ int x,y; bool operator < (const ...
分类:其他好文   时间:2015-05-04 18:06:21    阅读次数:100
Java for LeetCode 029 Divide Two Integers
Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.解题思路:既然不呢个用乘除和取模运算,只好采用移位运算,可以通过设置一个leng...
分类:编程语言   时间:2015-05-04 17:20:02    阅读次数:149
C++11 对 string的改变
元素保证是连续存储了 operator[]之类的不可以invalidate iterator了,于是COW不行了 不再是container所以swap不需要遵守不能copy/move/swap元素的规定,于是SSO可行了 reference不再是Allocator::reference了,而直接就是...
分类:编程语言   时间:2015-05-04 13:23:38    阅读次数:128
Cdev
1,#和##操作符Operator,使用 首个参数返回为一个带引号的字符串predefined variablewas not declared in the scope;2,调试debuging program,like breakpoint;abort();把此函数放置于你想一终端语句的下一行;...
分类:其他好文   时间:2015-05-03 23:40:21    阅读次数:270
C++拷贝构造函数
#include using namespace std;class Test1 { public: Test1() { //赋值 //p=NULL; // or p=new int; } //重要 Test1& operator=(const Test1& test1) { i...
分类:编程语言   时间:2015-05-03 14:39:17    阅读次数:109
复习一些基本的C/C++数据类型
size_tsize_t. A basic unsigned integer C/C++ type. It is the type of the result returned by sizeof operator. The type's size is chosen so that it coul...
分类:编程语言   时间:2015-04-30 17:49:26    阅读次数:135
2015430 加法阶段一的封装测试
public class fdgfg{ Vector v; public fdgfg() { v = new Vector(); } public void produceExpression(int bit,char operator) { ...
分类:其他好文   时间:2015-04-30 17:48:25    阅读次数:137
c++之运算符重载
所谓运算符重载,可以简单理解为函数的重载,而operator@就是函数名,@表示任何运算符,加减乘除等。#include using namespace std;class Complex{public: Complex(){real = 0; imag = 0;}; Complex(d...
分类:编程语言   时间:2015-04-30 00:52:54    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!