〖C/C++〗
文章平均质量分 70
furtherchan
雨后登楼看山,午倦一方藤枕,客至汲泉烹茶,柳阴堤畔闲行,暑至临溪濯足,接客不着衣冠。
展开
-
过完春节,手生了,写个双向非循环链表
//doubleLinkList.c #include #include #include /************************************************************************//* 双向非循环链表 *//原创 2010-02-23 16:12:00 · 787 阅读 · 0 评论 -
指针与二维数组
#includeint main(){ int array[3][4] ={ {7,10,-2,3}, {14,30,6,-15}, {0,5,27,-7}}; int (*p)[4] = &array[0]; int i,j,sum=0; for(i = 0; i { for(j = 0; j { sum = sum + *(*(p+i)+j); //sum = sum原创 2010-03-17 19:34:00 · 442 阅读 · 0 评论 -
统计字符串中数字并以整数存到数组中
#includeintmain( int argc, char *argv[] ){ char str[] = "a123x456 17960?302tab5876"; int a[20] = {}; char *p; int i=0; p = str; while( *p ) { if(*p = 0 ) { while(*p = 0 ) { a[i] = a[i]原创 2010-03-25 19:53:00 · 793 阅读 · 0 评论 -
消除宏的副作用
#include /* * About: Demo of macro side effective and how to resolve it * Author : FurtherChan * Date: Sat Apr 24,2010 */#define MIN_A(x, y) ((x) #define MIN_B(type, x, y) ({type _x = (x); type原创 2010-04-26 08:57:00 · 783 阅读 · 0 评论 -
使用backtrace调试
使用backtrace调试void dump(int signo){printf("\n ***** start dump *****\n");void*array[30];size_t size;char**strings;size_t i;size = backtrace (array,30);strings = backtrace_原创 2013-03-13 13:24:12 · 1113 阅读 · 0 评论 -
使用FreeType绘制字体
不带缓存的FreeType使用 1、 初始化库 FT_Init_FreeType( FT_Library *alibrary ); 2、 通过创建一个新的 face 对象来打开一个字体文件 FT_New_Face( FT_Library library, const char* filepathname,原创 2013-03-13 12:55:07 · 13812 阅读 · 0 评论