Effective
C++_笔记_条款002_尽量以const、enum、inline替换#define。
分类:
编程语言 时间:
2014-05-19 19:45:55
阅读次数:
332
1)内存间复制(非重叠)应用:比如将需要显示的内容,从缓冲区复制到内存先看等VOID
RtlCopyMemory(IN VOID UNALLGNED* Destination,IN CONST VOID UNALLGNED *Source,IN
SIZE_T Length);//表示要复制的内存长度...
分类:
其他好文 时间:
2014-05-19 18:49:01
阅读次数:
228
//#define LOCAL#include#includeusing namespace
std;int const MAX_N=100001;int const INF=10000000;int N,M,x[MAX_N];void init(){
for(int i=0;i1) {...
分类:
其他好文 时间:
2014-05-19 17:20:45
阅读次数:
204
//#define LOCAL#include#include#include#includeint
const MAX_N=101;typedef struct Point{ int x,y; bool operatorVec[i].y) { ...
分类:
其他好文 时间:
2014-05-19 17:08:45
阅读次数:
253
第九章 引用1. 什么是引用?引用就是别名。int
&ra=a;此处的&不是取址运算符,而是引用运算符3. 引用就是别名常量4. 引用对象只能 int &ra=a;//
注意定义引用时要对其初始化int &ra;ra=a; //这样是错误的,引用就像常量,只能初始化不能赋值对象也可以定义一个引用,但...
分类:
其他好文 时间:
2014-05-19 16:38:03
阅读次数:
253
第十四章 数组1. 什么是数组三要素:数组类型 数组名 下标2. 数组元素3.
数组下标越界一旦越界程序就会报错4. 倒序输出5. 将数组的下标定义为常量以便于修改6. 手动操作数组元素7.
数组的初始化空间不够报错,多了用0补①②字符数组的初始化char array[10]={“hello”}等价...
分类:
其他好文 时间:
2014-05-19 16:21:45
阅读次数:
297
vector::const_iterator result =
find(vector.begin(). vector.end(),search_value); 如果查找失败,分会end()
如果有两个,会返回哪一个的迭代器?int *reauslt = find(ia,ia+6,search_va...
分类:
编程语言 时间:
2014-05-19 15:15:33
阅读次数:
324
1 #include 2 #include 3 using namespace std; 4 5
void modifyArray(int [], int); 6 void modifyElement(int); 7 8 int main() 9 {10
const int arr...
分类:
其他好文 时间:
2014-05-19 15:12:27
阅读次数:
257
/*==================================================*| 分解质因数,可能有些地方需要改为long long
\*==================================================*/
const int MAXN=100010;
int prm[MAXN+1];
bool is[MAXN+1];
int g...
分类:
其他好文 时间:
2014-05-18 10:12:14
阅读次数:
334
题目一:求1!+2!+…..+n! 的和的后6位,(注意n的范围)
#include
using namespace std;
const int MAX = 1000000;
int getResu(int n)
{
int sum=0;
int temp= 1;
for(int i=1; i <= n; i++)
{
temp *= i;
temp %= MAX;
...
分类:
其他好文 时间:
2014-05-18 03:36:19
阅读次数:
223