
c程序
klggg
规划人生
展开
-
从文件里得到所有的邮件地址(源代码)
很想实现类似 php函数里的 ereg 功能.欢迎探讨/* * 从文件里得到邮件地址 2003-2-8 17:15 */#include #include #define mailMaxLen 20#define bufMaxLen 200long filesize(FILE *stream) { long curpos, length; curpos = ftell(stream原创 2003-02-24 13:14:00 · 1554 阅读 · 0 评论 -
thrift cpp 相关测试
thrift cpp 相关测试( linux 环境)下载解包 thrift 后,进行 tutorial 目录 1. 打开 tutorial.thrift ,在 i32 add(1:i32 num1, 2:i32 num2) 下面另起一行添加以下方法 i32 gggtest(1:i32 num1, 2:i32 num2), 2. 用 thrif原创 2010-04-16 16:01:00 · 701 阅读 · 0 评论 -
CString用CFile保存后乱码
装了 vs2008 ,调试 activex 从js传内容到控件,由控制写入文件.发现CString用CFile保存后乱码,比如 传入的是 123 ,写到文件用UE打开看里变成了 1x2x3 x 为 /0 字符尝试了N多方法,终于这里找到原因. http://wenwen.soso.com/z/q109705519.htm 是unicode的问题,vs2005默认为Uni原创 2009-11-12 15:53:00 · 3421 阅读 · 0 评论 -
esseract-ocr很不错的orc识别系统
tesseract-ocr很不错的orc识别系统,可更加需求做训练 然后识别训练 见:http://groups.google.com/group/tesseract-ocr/browse_thread/thread/983317066a5acbd1/58ccdd7c1da5884e?lnk=gst&q=train#58ccdd7c1da5884e sourc转载 2009-11-01 23:21:00 · 2346 阅读 · 0 评论 -
linux c++ MD5
#include #include #include #include #include #include using namespace std; /** * @模拟 php 的 md5函数,返回md5 * len 要返回从左到右几个字符 */void phpMd5(const string& src,char* md,int len=32)原创 2009-06-25 12:51:00 · 1447 阅读 · 0 评论 -
C指针声明解读之左右法则
http://hi.baidu.com/happynp/blog/item/58140451abb7802142a75bc3.html C语言所有复杂的指针声明,都是由各种声明嵌套构成的。如何解读复杂指针声明呢?右左法则是一个既著名又常用的方法。不过,右左法则其实并不是C标准里面的内容,它是从C标准的声明规定中归纳出来的方法。C标准的声明规则,是用来解决如何创建声明的,而右左法则是用来解决转载 2008-10-02 22:38:00 · 555 阅读 · 0 评论 -
apache module 小例
/** * 编译后 * 在 httpd.conf 文件中添加 * * * LoadModule access_ctl_module modules/libmod_access_ctl.so * * * * */#include #include "apr_getopt原创 2008-06-26 20:59:00 · 762 阅读 · 0 评论 -
BMP图片显示程序
/*2002-11-28 * *//*位图文件头*/typedef struct{ int imgType;/*位图的标志,即ASCII码为BM。两字节*/ long imgHeadSize;/*位图的文件的总字节数 4字节*/ long imgReserved;/*保留字4字节00 00 00 00*/ long imgBeginBit;/*位图阵列的起始位置,一般是54字节开始为位图阵列*/}原创 2006-05-20 02:28:00 · 2128 阅读 · 2 评论 -
俄罗斯方块
/**//* 2002-11-13 *俄罗斯方块 *Made by GGG */#include stdio.h># include stdlib.h>#include dos.h>#include graphics.h>#define TIMER 0x1c#define VK_LEFT 0x4b00#define VK_RIGHT 0x4d00#define VK_DOWN 0x5原创 2006-05-20 02:23:00 · 1531 阅读 · 0 评论 -
从文件里得到url地址
/* * 从文件里得到url地址 2003-2-8 17:15 */#include #include #define mailMaxLen 20long filesize(FILE *stream) { long curpos, length; curpos = ftell(stream); fseek(stream, 0L, SEEK_END); length = ftel原创 2006-05-20 02:13:00 · 1166 阅读 · 0 评论 -
用c socket 方式下载网页
#include #include #include #include #include #include #include #include #include #include #include #include #define MaxRecvLen 500//定义网站结构struct DOMAIN{ char url[255]; //http://www.xh88.com:80原创 2006-01-25 21:32:00 · 3623 阅读 · 0 评论 -
俄罗斯方块 tc版
/* 2002-11-13 *俄罗斯方块 *Made by GGG */#include # include #include #include #define TIMER 0x1c#define VK_LEFT 0x4b00#define VK_RIGHT 0x4d00#define VK_DOWN 0x5000#define VK_UP 0x4800#define VK_原创 2006-01-25 21:29:00 · 1332 阅读 · 0 评论 -
php 与 CPP 共用aes,ecb模式加密
代码地址http://www.phpaes.com经验证,和cpp得到的加密串一致。原创 2011-02-21 17:28:00 · 2187 阅读 · 1 评论