Monday, June 30, 2008

static indicator

static variable就像是global變數差別只在它的visible範圍只在該scope內所以static變數的初始值就是0當然你也可以像global變數一樣指定初始值給它

static function表示該function的visible範圍只在該.cpp內可以避免污染global namespace所以很多個.cpp內可以有同樣名稱的static function

0 Comments:

Post a Comment

<< Home