13. Use objects to manage resources.總結:第一,為了防止資源流失,請使用RAII對象,它們在建構函式中獲得資源並在西溝函數中釋放資源。第二,兩個常被使用的RAII class分別是tr1::shared_ptr和auto_ptr。前者通常是較佳選擇,因為其copy行為比較直觀。若選擇auto_ptr,複製動作會使它(被複製物)指向null。14.Think carefully about copying behavior in
49. Understand the behavior of the new-handler.總結:第一,set_new_handler允許客戶指定一個函數,在記憶體配置無法獲得滿足時被調用。第二,Nothrow new是一個頗為局限的工具,因為它只適用於記憶體配置;後繼的建構函式調用還是可能拋出異常。50. Understand when it makes sense to replace new and delete.替換編譯器提供的operator new或operator
WinForm下的ComboBox預設是以多行文本來設定顯示列表的, 這通常不符合大家日常的應用, 因為大家日常應用通常是鍵/值對的形式去綁定它的.那麼用索引值對的形式如何做?因為Combox的每一個項的值是一個object, 實際上就是一個鍵/值對.我用的是下面這個類的執行個體作為它的一個項:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
C - A Coloring GameCrawling in process...Crawling failedTime Limit:500MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPractice SGU 328 DescriptionTwo players play a graph coloring game. They make moves in turn, first
delegate是C#中的一種類型,它實際上是一個能夠持有對某個方法的引用的類。與其它的類不同,delegate類能夠擁有一個簽名(signature),並且它只能持有與它的簽名相匹配的方法的引用。A delegate declaration defines a reference type that can be used to encapsulate a method with a specific signature. A delegate instance encapsulates a