博文

字符串匹配(2006-08-01 21:07:00)

摘要:字符串匹配在Windows命令的使用中,有两个经常使用的通配符:*和?。*表示0个、1个或者多个字符,?表示0个或者1个字符。使用通配符可以利用dir命令搜索特定名字的文件。例如 引用: J:\WINDOWS\system32>dir msvc*dll 驱动器 J 中的卷是 WinXP 卷的序列号是 58A6-6950 J:\WINDOWS\system32 的目录2002-01-05  03:38            54,784 msvci70.dll2001-11-03  01:19            50,688 msvcirt.dll2001-11-03  01:19           565,760 msvcp50.dll2001-11-03  01:19           401,462 msvcp60.dll2002-01-05  03:40           487,424 msvcp70.dll2003-03-18  22:14           499,712 msvcp71.dll2002-01-05  03:37    &n......

阅读全文(5981) | 评论:0

模板的妙用(2006-08-01 20:59:00)

摘要:#include <cstdlib>#include <iostream>using namespace std;template<typename T, size_t n>bool __is_array(T (&a)[n]) {return true;}bool __is_array(...) {return false;}template<typename T>bool IsArray(T &a){    return __is_array(a);}template<typename T, size_t n>void Test( T (&array)[n], bool first = false);template<typename T, size_t n>void Test_Shadow( T (&array)[n]);template<typename T>void Test( T& ){}template<typename T>void Test_Shadow( T& ){}template<typename T, size_t n>void Test( T (&array)[n], bool first ){    if(first) cout << "the array is like A";   &n......

阅读全文(3013) | 评论:0