![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
程序设计
文章平均质量分 59
s_kuang
这个作者很懒,什么都没留下…
展开
-
关于回调函数
对指针的应用是C语言编程的精髓所在,而回调函数就是C语言里面对函数指针的高级应用。简而言之,回调函数是一个通过函数指针调用的函数。如果你把函数指针(函数的入口地址)传递给另一个函数,当这个函数指针被用来调用它所指向的函数时,我们就说这个函数是回调函数。为什么要使用回调函数呢?我们先看一个小例子: Node * Search_List (Node * node, const in转载 2009-11-07 09:25:00 · 536 阅读 · 0 评论 -
计算机中内存大小单位及其关系你知道有哪些?
<br />1 Byte = 8 bit<br />1 K Byte = 1024 Byte<br />1M Byte = 1024 K <br />1G Byte = 1024M<br />1T(Tera) Byte= 1024G Byte<br />1P(Peta) Byte = 1024T Byte<br />1Exa Byte = 1024 P Byte ,此单位可以存储全人类所有的话。<br />1Zetta Byte = 1024 Exa Byte<br />1Yotta Byte = 10原创 2011-04-24 13:48:00 · 2980 阅读 · 0 评论 -
如何降低平台和业务的数据结构的耦合
问题背景:系统的模块划分为平台和业务,分别由平台组和业务组各自维护各自的代码。typedef struct plat_container{ int a1; /*平台用*/ int a2; /*平台用*/ .... int *p_an; /*平台用*/ int serv11; /*业务1用*/ int serv12; /*业务1用*/ ..... int servn; /*业务n 用*/}plat_container_s;原创 2011-02-26 20:22:00 · 892 阅读 · 0 评论 -
单链表反转实现
<br />struct link<br />{<br /> struct link *next;<br /> int data;<br />};<br />struct link *g_list = 0;<br />int link_init(struct link ** head)<br />{<br /> int i = 0;<br /> struct link *p = *head;<br /> struct link *tmp = 0;<br /> p = ma原创 2010-06-26 23:47:00 · 408 阅读 · 0 评论 -
c中有用的几个宏定义
1、#define ALIGN(x,al) (((x) + (al) - 1) & ~((al) - 1)) 适用于al 必须为2的幂,比如4、8、16、32、64等 2、#define ALIGN(x,al) (((x)+(al) -1)/(al)*(al)) 实现对x 按照al 大小对齐。 3、FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))原创 2010-01-01 23:15:00 · 733 阅读 · 1 评论 -
linux乱码解决
对于国内的Linux用户,经常烦恼的一个问题是:系统常常在需要显示中文的时候却显示成了乱码,而由于某些原因,需要英文界面的系统的时候,却苦于系统不能正常输入和显示中文.另外,由于大部分主要Linux发行版都是以英语为主体的,英文界面的系统和应用程序不管在界面的美观程度和稳定程度上都比中文的略好一些,各种奇怪的BUG也要少一些。因此,很多稍微有英语转载 2009-12-21 11:40:00 · 5430 阅读 · 0 评论 -
Inversion of control
Inversion of controlFrom Wikipedia, the free encyclopediaJump to: navigation, searchThis article is in need of attention from an expert on the subject. WikiProject Computer scien转载 2009-12-14 23:16:00 · 734 阅读 · 0 评论 -
callback func
For a discussion of callback with computer modems, see callback (telecommunications).In computer programming, a callback is executable code that is passed as an argument to other code. It allows a l转载 2009-12-14 23:09:00 · 1099 阅读 · 0 评论 -
如何查看mysql日志
在你的 my.cnf 或 my.ini 文件中加入下面一行 [mysqld] log =d:/mysql/log/sql.log 你就可以有 SQL 日志了, 它是一个文本文件一般可以放在下面目录下:/var/lib/mysql转载 2009-12-08 19:49:00 · 697 阅读 · 0 评论 -
关于字节对齐问题
我们的讨论从一道经典的题目开始:Intel和微软同时出现的面试题#pragma pack(8)struct s1{char a;long b;};struct s2{char c;s1 d;long long e;};#pragma转载 2011-08-31 21:18:20 · 1949 阅读 · 0 评论