Monday, June 30, 2008

static indicator

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

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

Tuesday, June 03, 2008

send the output data into file

if exist a execution file
a.exe
we would send the output data of a.exe
we command following
a.exe >output.txt
and the output data would be written into output.txt