C/C++
iteye_20036
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
linux下C语言连接mysql数据库
我用的是ubuntu10.10, mysql是使用sudo命令安装; 在linux下使用C语言连接mysql数据库, 首先执行命令: sudo apt-get install libmysqlclient-dev 然后,执行下面的命令: mysql_config --libs mysql_config --cflags 然后,写一个测试程序showtables.c,用来...2010-11-16 10:41:52 · 159 阅读 · 0 评论 -
C++教程59 函数模板
#include <iostream> using namespace std; template <class FIRST, class SECOND> FIRST smaller(FIRST a, SECOND b) { return (a<b?a:b); } int main(){ int x = 89; doub...原创 2014-07-03 15:07:10 · 213 阅读 · 0 评论 -
简单epoll多线程服务器
学习 /* Linux 2.6 x86_64 only*/ #include <pthread.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <fcntl.h>...原创 2012-07-30 15:14:57 · 251 阅读 · 0 评论 -
简单epoll服务器
学习 #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <netinet/in.h> #include <sys/socket....原创 2012-07-30 15:04:30 · 136 阅读 · 0 评论 -
一个多进程框架
从别处找来的,记一下,学习~ /*============================================================================= # # Description: 多进程的一个框架,大家可以直接使用,已经经过功能测试和压力测试。 # 编译:g++ forkwork_use.cpp -o forkwork_use ...原创 2012-07-30 12:04:37 · 393 阅读 · 0 评论 -
gcc加载时的共享库设置
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH -L 共享库目录 -l 共享库文件 -lthread -levent -lACE -I 包含头文件的目录原创 2012-03-21 17:13:26 · 147 阅读 · 0 评论 -
libevent—异步IO编程
原地址:http://www.wangafu.net/~nickm/libevent-book/01_intro.html 关于 本文档旨在教会你如何使用libevent2.0编写高效可移植的异步网络程序,我们假定: 你熟悉C语言。 你熟悉C语言基本网络接口 (比如socket(), connect()等)。 示例程序 本文档所有例程...原创 2012-03-14 13:57:47 · 299 阅读 · 0 评论 -
C语言实现的mapreduce小程序
#include <stdio.h> typedef int (*mapFunction)(int); typedef int (*reduceFunction)(int,int); #define ERROR -1 void map(mapFunction func, int *list, int len) { int i; for(i=0; i&...原创 2012-03-05 14:47:46 · 729 阅读 · 0 评论 -
linux下itoa
#include <stdio.h> char *itoa(int value, char *string, int radix) { int rt=0; if(string==NULL) return NULL; if(radix<=0 || radix>30) return NULL; rt...原创 2012-02-10 16:22:10 · 228 阅读 · 0 评论 -
C++教程60 类模板
#include <iostream> using namespace std; template <class T> class Bucky{ T first, second; public: Bucky(T a, T b) { first = a; second = b; } T bigger(); }; ...原创 2014-07-03 15:12:20 · 241 阅读 · 0 评论
分享