- 博客(3)
- 收藏
- 关注
原创 C++中的闭包
Wikipedia上对闭包的定义: 在一些语言中,在函数中定义另一个函数时,如果内部的函数引用了外部的函数的变量,则可能产生闭包。运行时,一旦外部的 函数被执行,一个闭包就形成了,闭包中包含了内部函数的代码,以及所需外部函数中的变量的引用。其中所引用的变量称作上值(upvalue)。 用Lisp举个例子: (let* ((len (length prefix))
2013-05-07 00:11:08 749
原创 RCS keyword strings
在.c/.cpp文件中定义如下字符串后,使用linux下的ident命令就可以查找出这些字符串。这样非常便于写lib时把版本写进去,方便使用者追踪。 static char const rcsid[] = "$Id: f.c,v 5.4 1993/11/09 17:40:15 eggert Exp $"; 输出效果: $ ident am am: $Version: p
2013-05-07 00:08:02 517
转载 What are all the common undefined behaviour that a C++ programmer should know about?
转自stackoverflow:http://stackoverflow.com/questions/367633/what-are-all-the-common-undefined-behaviour-that-a-c-programmer-should-know-ab Pointer Dereferencing a NULL pointerDereferencing
2013-05-07 00:05:33 533
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人