装饰者模式可以动态地将责任附加到对象上,若上扩展功能,装饰者提供了比继承更有弹性的替代方案。 ...
In this blog post, I will give an introduction to a hashing methodology called Linear Hashing, which is one of the Dramatic Hashing methods. ...
In the man page of malloc, there(NOTES section) is a paragraph as follows: Normally, malloc() allocates memory from the heap, and adjusts th ...
This article explains when we should use the qualifier explicit and when we shouldn’t. Avoids undesirable conversions Normally, if a constru ...
While reading Advanced Programming in the UNIX Environment, I noticed this: #include FILE* fmemopen(void *restrict buf, size_t size, const ...
这篇文章主要总结 Linux/C 下常用的捕捉错误信息的函数用法和一些注意事项,包括strerror()、perror()、ferror() 0x01 strerror:返回错误原因的描述字符串 #include char * strerror(int errnum); 说明: ...
do{}while(0)有时可以方便地解决一些问题 辅助定义复杂宏,避免引用时出错 看下面这个宏: #define DO_SOME_WORK() \ func1(); \ func2(); 本意是通过调用 DO_SOME_WORK() ,来执行 func1() 和 ...