原创 Heap: Pleasures and Pains

Murali R. KrishnanMicrosoft Corporation February 1999 Summary: Discusses common heap performance problems and how to pr

原创 Designated Initializers

6.26 Designated Initializers Standard C90 requires the elements of an initializer to appear in a fixed order, the same

原创 巴科斯-諾爾範式

巴科斯-諾爾範式(也稱爲巴科斯-瑙爾範式、巴克斯-諾爾範式),即 BNF,是一種用於表示上下文無關文法的語言,上下文無關文法描述了一類形式語言。它是由約翰·巴科斯(John Backus)和彼得·諾爾(Peter Naur)首先引入的用來

原创 Objective-C 中方法的重載,覆蓋和隱藏

在C++中,類方法有重載(overload)、覆蓋(override)和隱藏(hide)的概念(當然,函數也可重載。)。 C++的覆蓋和隱藏是個非常容易混淆的概念,尤其隱藏。學到Objective-C,因爲它與C++有相似的地方,所以對此

原创 Segment/Section/Virtual Memory/Page之間的區別

對於 Segment, Section, Virtual Memory, Page 這些詞我們肯定不會陌生. 但在閱讀一些書籍和文章的時候, 不知是那些作者的緣故還是自己的原因, 我們不能正確區分他們之間的區別. 我不得不承認, 真要 1

原创 又是類的 "構造函數", "拷貝構造函數" 和 "賦值操作符"

// -------------------------------------------------------------------[代碼]---- #include "iostream" // 這裏不使用"尖括號"是因爲 HTM

原创 if ( yy == xx.getValue() ) 編譯器擴展模擬代碼

《深度探索C++對象模型》P.239 中間部分僞碼模擬: // VC++ 2005 #include <stdio.h> class X; class Y; extern X g_x; extern Y g_y;

原创 多重繼承下, 執行期 this 指針的調整示例代碼

// VC++ 2005 #include <stdio.h> class A { public: A() { printf(">> 在類 A 的 constructor 中, this 的值是 0x

原创 POD 類型

http://www.fnal.gov/docs/working-groups/fpcltf/Pkg/ISOcxx/doc/POD.html C++ Language Note: POD Types Walter E. Brown Sep

原创 字符串分割(split 方法)

幫助:>>> help(str.split) Help on method_descriptor: split(...) S.split([sep[, maxsplit]]) -> list of strings

原创 代名符

在 C++ 語言編程設計中常利用 #define 語句定義一類空的字符串代換技術, 被稱爲代名符定義 . 代名符在程序中不起任何實際作用, 只能放在行首用來說明程序的設計者, 類的歸屬, 設計時間, 程序的分類或所處的總體位置等, 有助於

原创 後自增(減)的結果不是左值

#include <cstdio> int main() { int foo = 5; void* p = NULL; printf_s("Address of foo is 0x%p. /r/n",

原创 iOS UIControl 幾個事件的說明

在控件事件中,簡單解釋下下面幾個事件。說明:由於是在“iOS 模擬器”中測試的,所以不能用手指,只能用鼠標。1)UIControlEventTouchDown指鼠標左鍵按下(注:只是“按下”)的動作2)UIControlEventTouc

原创 Xcode編譯錯誤:Synthesized property 'xxxXXX' must either be named the same as a compatible ivar or mus

---- 2011.07.21 更新 ---- // 2011.07.21 // Xcode 4.0.2 // 64-bit @interface IvarNameTest : NSObject { @private

原创 多重繼承內存佈局分析

// VC++ 2005 /Gd // acronym(Root Level) = RL // acronym(Second Level) = SL // acronym(Third Level) = TL #incl