![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 53
kerwin_zxc
这个作者很懒,什么都没留下…
展开
-
进程通信pipe, 输入输出,进程间互相读写
#include #include #include #include #include #define MAXLINE 80void *parent_read_proc(void *p){ int p_fd_r = (int)p; char line[MAXLINE] = {0}; int len = 0; int n = 0; while(1) { memse原创 2012-08-17 11:38:09 · 1329 阅读 · 0 评论 -
curl POST demo
// curltest.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "curl/curl.h"#include #include #include #define TRUE 1using namespace std;#pragma comment原创 2013-09-05 16:47:08 · 1803 阅读 · 0 评论 -
cocos2d-x 资源集合
http://cocos2d-x.org/ 官网主席http://www.cnblogs.com/GameDeveloper/子龙山人- 博客园http://www.cnblogs.com/andyque/http://www.cnblogs.com/andyque/archive/2011/08/08/2131019.htmlkmyhy的专栏http:/原创 2013-02-19 18:31:35 · 1361 阅读 · 0 评论 -
cocos2d-x 添加广告条
1: IOS--iAdsIOS下比较简单,加入storekit,添加三行代码就成功了(摘自 @冬天的林 新浪微博)2:Android--AdmobAndroi下陷阱较多。我按照网上的教程还是遇到了一些问题。下面大多摘录自http://www.pin5i.com/showtopic-admob-android-tutorial.html。比较特殊的地方用蓝色转载 2013-02-19 18:28:05 · 1701 阅读 · 0 评论 -
闪电算法
function drawLightning(x1,y1,x2,y2,displace){ if (displace graf.moveTo(x1,y1); graf.lineTo(x2,y2); } else { var mid_x = (x2+x1)/2; var mid_y = (y2+y1)/2; mid_x +=转载 2013-02-19 18:20:48 · 4955 阅读 · 0 评论 -
完成了对CCEditBox win32封装, 完善了 editbox ios版本BUG
项目中使用到了 cceditbox, 头分配了一个任务,让封装一个editbox win32版本,以为网上能找到, 结果搜索半天没找到,没办法,自己动手封装,发现其实也没么难,前后不过近3小时, 效果还不错, 原以为就此结束,在测试android 时,还可以,测试IOS, 一直不显示真正的编辑框控件,只显示eidtbox内部的buttonc control, 而真正的编辑框其实在坐标原点下方,原创 2013-01-27 14:23:40 · 3833 阅读 · 5 评论 -
完成了coocs2d-x richtext 的封装
最近写了一款 html版本的richtext, 采用html标记方法 hello world,总体来说效果还可以,支持下划线,颜色,描边,图片,缩进,自动换行,字体,字体大小, 标记一下,以示庆祝原创 2013-01-27 14:33:11 · 2557 阅读 · 7 评论 -
STL sort 排序
详细解说 STL 排序(Sort)详细解说 STL 排序(Sort) 作者Winter详细解说 STL 排序(Sort)0 前言: STL,为什么你必须掌握1 STL提供的Sort 算法1.1 所有sort算法介绍1.2 sort 中的比较函数1.3 sort 的稳定性1.4 全排序1.5 局部排序1.6 nth_element转载 2012-08-23 09:17:31 · 705 阅读 · 0 评论 -
STL中map的数据结构
1.map定义map是键-值对的集合。map类型通常可以理解为关联数组:可使用键作为下标来获取一个值,正如内置数组类型一样。而关联的本质在于元素的值与某个特定的键相关联,而并非通过元素在数组中的位置来获取。map模板原型:template , class Allocator = allocator > > class map;key:关键值的类型转载 2012-08-21 20:27:46 · 710 阅读 · 0 评论 -
dijkstra 算法
#include #include #include #define NUM 5pthread_mutex_t lock[NUM] = {PTHREAD_MUTEX_INITIALIZER};void *thread_proc(void *p){ int pos = (int)p; int right = pos; int left = ((pos - 1) < 0)原创 2012-08-17 11:28:52 · 497 阅读 · 0 评论 -
生产者,消费者,pthread_cond_t pthread_mutex_t
#include #include #include struct msg { struct msg *next; int num;};struct msg *head = NULL;pthread_cond_t has_product = PTHREAD_COND_INITIALIZER;pthread_mutex_t lock = PTHREAD_MUTEX_INITIA原创 2012-08-17 13:41:57 · 1253 阅读 · 0 评论 -
2-bitmap 算法,可解决海量数据问题,减少内存使用
#include "stdafx.h"#include #include using namespace std;unsigned char flags[1000];unsigned get_val(int idx){ int i = idx / 4; int j = idx % 4; unsigned ret = (flags[i]&(0x3> (2*j); retur原创 2012-08-15 15:54:30 · 1028 阅读 · 0 评论 -
信号模拟 sleep 函数,定时器
#include #include #include void sig_alrm(int signo){ printf("this is the alarm function\n");}unsigned int mysleep(unsigned int nsecs, __sighandler_t handler){ struct sigaction newact, oldac原创 2012-08-17 11:36:09 · 505 阅读 · 0 评论 -
linux C++ 资料集合
GCC 中文手册 http://www.nbfan.com/forum/dispbbs....&ID=1433&page=1 GNU make 指南 http://www.linuxsir.org/bbs/showthr...&threadid=40431 autoconf-2.57手册(英文)原创 2012-08-17 16:53:08 · 627 阅读 · 0 评论 -
线程同步 pthread_mutex_t pthread_cond_t sem_t
pthread_cond_t #include #include #include struct msg { struct msg *next; int num;};struct msg *head = NULL;pthread_cond_t has_product = PTHREAD_COND_INITIALIZER;pthread_mutex_t lock = P原创 2012-08-17 13:53:31 · 2022 阅读 · 0 评论 -
C++ 11 新特性集合
这篇文章讨论了一系列所有开发者都应该学习和使用的C++11特性,在新的C++标准中,语言和标准库都加入了很多新属性,这篇文章只会介绍一些皮毛,然而,我相信有一些特征用法应该会成为C++开发者的日常用法之一。你也许已经找到很多类似介绍C++11标准特征的文章,这篇文章可以看成是那些常用特征描述的一个集合。目录:auto关键字nullptr关键字基于区间的循环Override和fina转载 2014-09-02 18:23:45 · 718 阅读 · 0 评论