随笔分类 -  C/C++

win32环境下 读入文件
摘要:#include struct _finddata_t propty_file; intptr_t hFile = NULL ; hFile = _findfirst(pdir,&propty_file) ; if( -1L == hFile) { cout<< "search dir failed \n" << endl; return false; } do { ... 阅读全文
posted @ 2006-11-11 23:26 DAVID'S BLOG 阅读(252) 评论(0) 推荐(0)
引用无名对象的 拷贝构造函数
摘要:#include using namespace std; class Internet { public: Internet(char *name,char *address) { cout<<"载入构造函数"<<endl; strcpy(Internet::name,name); ... 阅读全文
posted @ 2006-09-11 00:52 DAVID'S BLOG 阅读(288) 评论(0) 推荐(0)
IP TCP UDP 结构
摘要:IP Header Format : RFC 791 The IP header structure is as follows: 4 8 16 ... 阅读全文
posted @ 2006-08-29 23:38 DAVID'S BLOG 阅读(1758) 评论(0) 推荐(0)
1.文件的查找
摘要:1.文件的查找 当对一个文件操作时,如果不知道该文件是否存在,就要首先进行查找。MFC中有一个专门用来进行文件查找的类CFileFind,使用它可以方便快捷地进行文件的查找。下面这段代码演示了这个类的最基本使用方法。 CString strFileTitle; CFileFind finder; BOOL bWorking = finder.FindFile("C:\\window... 阅读全文
posted @ 2006-04-01 20:16 DAVID'S BLOG 阅读(292) 评论(0) 推荐(0)
如何在C语言中巧用正则表达式
摘要:#include #include #include /* 取子串的函数 */ static char* substr(const char*str,unsigned start, unsigned end) { unsigned n = end - start; static char stbuf[256]; strncpy(stbuf, str + start, n); stbuf[n]... 阅读全文
posted @ 2006-01-12 20:38 DAVID'S BLOG 阅读(483) 评论(0) 推荐(0)
关类型转换-作为参考
摘要:说明:本文纯粹是总结一下有关类型转换的贴子, 本人并未对所有方法都做测试,仅仅是为了给大家一个参考。 读者层次:初学 int i = 100;long l = 2001;float f=300.2;double d=12345.119;char username[]="程佩君";char temp[200];char *buf;CString str;_variant_t v1;_bstr_t v... 阅读全文
posted @ 2005-09-25 22:33 DAVID'S BLOG 阅读(1065) 评论(0) 推荐(0)
Windows Socket 简介
摘要:Windows Socket 简介===============================这篇文章出自bugfree/CSDN平台: VC6 Windows XP 简介:------- Windows 的Socket函数有许多, 我没有做详细介绍, 这里的函数都是简要说明其用途, 详细用法请参考MSDN. 这里的主要目的是为了后面的三个应用服务. 函数说明:--------- WSA... 阅读全文
posted @ 2005-09-25 13:24 DAVID'S BLOG 阅读(1721) 评论(0) 推荐(0)