c++设计模式学习笔记(一)
摘要:1. Factory 模式 Factory设计模式是主要是为了方便对象的创建而建立的,封装了对对象的创建。这样我们就能通过调用ConcreteFactory中的CreateProduct ()方法创建一个Product 子类对象,而不需要过多的继承。Factory 模式主要适合要创建的对象属于一类,如果要创建的对象不属于一类,那么就要用到AbstractFactory...
阅读全文
posted @
2009-03-31 18:47
Alvin_Xu
阅读(387)
推荐(0)
Windows API 学习笔记
摘要://test thread #include #include #define MAX_NUM 5 typedef struct TEST_STRUCT// { DWORD i; DWORD dwRandom; }TEST_STRUCT,*TEST_PTR; DWORD WINAPI ThreadProc(LPVOID lpParameter)// { TEST_PTR test...
阅读全文
posted @
2009-03-25 16:54
Alvin_Xu
阅读(358)
推荐(0)
qsort的7种用法(转)
摘要:七种qsort排序方法 一、对int类型数组排序 int num[100]; Sample: int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } qsort(num,100,sizeof(num[0]),cmp); 二、对char类型数组排序(同int类型) ...
阅读全文
posted @
2009-03-23 17:17
Alvin_Xu
阅读(282)
推荐(0)
遍历文件夹中的文件(c++)
摘要:Source code: /*---------------------------------------------------------------- // Copyright (C) 2008 ShanDong University At Weihai // FileName:Struct_type.cpp // Function Description:this program ca...
阅读全文
posted @
2009-03-20 12:30
Alvin_Xu
阅读(2508)
推荐(0)
文本分割工具(c\c++)
摘要:#include #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int count=0,standard; char ch; string str=""; char filename[20]; cout>standard; ...
阅读全文
posted @
2009-03-19 14:51
Alvin_Xu
阅读(369)
推荐(0)
"list iterator not decrementable"
摘要:解决方案: add #define _HAS_ITERATOR_DEBUGGING 0 after #include "stdafx.h"
阅读全文
posted @
2009-03-18 17:57
Alvin_Xu
阅读(538)
推荐(0)