最近把一個VC6.0的項目升級到VC2008,主要是有點厭倦了VC6那冷冰冰的古老面孔,想換點新鮮感。順便說一下,項目中使用了Notes API C庫來實現郵件的訪問。重新編譯並不像想象中的那麼困難重重,無非就是修正了一些字串轉換方面的warning和error。編譯完成後,隨手開啟CppUnit準備測試,砰,一個錯誤對話方塊跳出:Run-Time Check Failure #2 - Stack around the variable 'xxx' was
C++ 程式中,全域對象的初始化是在主函數([w]main() or [w]WinMain)被調用之前被初始化的。 Visual studio 編譯器在編譯時間會判斷編譯選項 "-subsystem" 來指點輸出程式是 "console" 還是 "windows",同時還會判斷程式中所使用的字元集是否是 unicode 的。 所以 visaul studio 的程式會有四個不同的程式入口 (entry)。
昨天看了雲風的《C有C的規則》(http://blog.codingnow.com/2006/05/c.html),最近也小有感受。先說說前幾天範的一個低級錯誤,以前寫java代碼的時候,高手們教導我說:局部變數用到的時候再聲明,這樣有利於程式的可讀性。所以我在c中寫出了類似如下的函數:void foo(void){ int a = 1; printf("%d",a); int b =
原文連結:http://developer.symbian.org/wiki/index.php/A_Comparison_of_Leaves_and_Exceptions 在Symbian系統的早期版本,當時C++還沒有異常機制,於是Symbian開發了自己的Leave和TRAP系統。到了Symbian OS
recently I was trouble shooting some c# projects exported a very famous game company. they make tools by using .net WPF frameworks. I was really headache on fixing most of bugs, because these bugs were just too stupid, and I can never think of it.
when using 'typedef' to re-define types in template scopes, vc compiler have no restriction in the use of key work 'typename', but gnu did, let's see following examples: template<typename ClassT>class TestTemplate{ typedef typename ClassT
Before this time, I always believe building the program with UNICODE or non UNICODE flag only effect the programatic side, and won't effect the system behavior. The problem arose with mixing usage of multi-byte and unicode character set
if we just call the c/c++ standare output interface, such as printf, in fact we ouput new text at the back of already printed text, but sometimes, we have to modify the printed text in current line. in this case, we can use the format simbol such as