码迷,mamicode.com
首页 >  
搜索关键字:operator-    ( 3564个结果
C++中bitset的实现(引用类的使用)
#include #include #define CHAR_BIT 8 using namespace std; template class bitset { typedef unsigned long _Ty; friend ostream & operator &_R) { for(size_t _P=_N;_P>0;) _O<<(_R.test(--_P)?'1...
分类:编程语言   时间:2015-04-08 11:04:38    阅读次数:160
hdu4739(回溯)
题意: 给出宝藏个数,然后给出每个宝藏的位置; 如果四个宝藏构成正方形就能取走; 问最多取走几个; #include #include #include using namespace std; const int N = 25; int n, ans; int cnt[105][105]; struct node { int x; int y; bool operator<(no...
分类:其他好文   时间:2015-04-07 23:34:29    阅读次数:384
C#的运算符重载
运算符重载看起来与标准静态方法声明类似,但它们使用关键字operator和运算符本身,而不是一个方法名:public static 返回类型 operator +(类型1 变量1,类型2 变量2){ //返回类型,类型1,类型2 ,可以相同,也可以全部不同}如果使用混合类型的话,需要注意的是,不.....
分类:Windows程序   时间:2015-04-07 19:18:20    阅读次数:125
C++字典的线性表实现。
#include #include using namespace std; struct SchoolNo { int no; friend bool operator == (const SchoolNo &school1,const SchoolNo &school2) { return (school1.no==school2.no); } friend ostrea...
分类:编程语言   时间:2015-04-07 15:42:48    阅读次数:123
C++中setbit的实现(没有使用引用技术)
#include #include #define CHAR_BIT 8 using namespace std; template class bitset { typedef unsigned long _Ty; friend ostream & operator &_R) { for(size_t _P=_N;_P>0;) _O<<(_R.test(--_P)?'1...
分类:编程语言   时间:2015-04-07 15:40:31    阅读次数:285
14.3. 算术操作符的重载
#include#includeusing namespace std;class sales_item{ friend istream& operator>>(istream &,sales_item&); friend ostream& operator<<(ostream&,const sal...
分类:其他好文   时间:2015-04-06 20:10:43    阅读次数:135
14.2. 输入和输出操作符重载
#include#includeusing namespace std;class sales_item{ friend istream& operator>>(istream &,sales_item&); friend ostream& operator>(istream& ism,sales_...
分类:其他好文   时间:2015-04-06 20:06:17    阅读次数:123
stl源码剖析 详细学习笔记 空间配置器
//---------------------------15/04/05---------------------------- /*     空间配置器概述:     1:new操作包含两个阶段操作         1>调用::operator new配置内存(底层使用malloc来申请内存)。         2>调用函数的构造函数,构造对象内容。 ...
分类:其他好文   时间:2015-04-06 11:29:31    阅读次数:151
C# 第四次作业
这节课老师首先介绍了structs 和class 的区别1. Structs are value types.2. Structs can be instantiated without using a new operator.Structs can declare constructors, b...
分类:Windows程序   时间:2015-04-06 06:13:25    阅读次数:202
数据结构(1) -- 线性结构
1、顺序存储//List.h#ifndef LIST_H_#define LIST_H_#define MAXSIZE 100typedef struct _Poly{ int a; int n; bool operator == (_Poly e) { if ...
分类:其他好文   时间:2015-04-05 11:47:32    阅读次数:149
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!