Re: [問題] 有關CLR的delegate...

看板C_and_CPP作者 (....)時間14年前 (2012/01/31 18:57), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《easterday (....)》之銘言: : 開發平台(Platform): (Ex: VC++, GCC, Linux, ...) : VC 2008 : 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) : CLI : 問題(Question): : 我有一份課本的範例碼(From D&D) : http://ideone.com/idOPm : 但是它是在以前的VC開發的 : 現在在VC2008編譯不過 : 能不能幫我看一下 自問自答 自問自答 http://ideone.com/bu63Q 重點是以下這兩句,要包含類別名稱和函式名稱,然後多一個&符號在前面 void BubbleSort::SortArrayAscending() { DelegateBubbleSort::SortArray(elementArray, gcnew DelegateBubbleSort::Comparator(this, &BubbleSort::SortAscending)); } void BubbleSort::SortArrayDescending() { DelegateBubbleSort::SortArray(elementArray, gcnew DelegateBubbleSort::Comparator(this,&BubbleSort::SortDescending)); } -------------------------------------------------------------------------------- -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 1.173.24.190
文章代碼(AID): #1F9yaBcg (C_and_CPP)
文章代碼(AID): #1F9yaBcg (C_and_CPP)