typeof

    2熱度

    4回答

    我有以下的方法,該方法需要一個類的類型作爲參數: public void test(Type proType){ } 我現在有一個大if else看起來像: if(proType == typeof(Class)){} 作爲有大約十個這看起來不整潔。 我試着把它轉換到開關,但無法讓它工作。 有沒有更好的做法,這或離開得到switch語句的工作? switch (proType)

    0熱度

    2回答

    我想要一個宏,它可以將一個變量的類型與另一個標記合併以創建一個新的標記。隨機例如: int var; int make_token(var); 這將成爲: int var; int var_int; 我試着來定義,像這樣的宏: #define make_token(x) x ## _ ## typeof(x) 但是,整個事情被擴展爲: int var; int var_typeo

    3熱度

    4回答

    我在哪裏做錯了? 我會等待 「類」,因爲這號碼的結果,但它沒有: 這是目標函數:

    0熱度

    2回答

    好吧,我想建立一個全球性的風格對我的表格的所有RichTextBox的: 有了: Public Class RichTextLabel Public Shared Sub AddTextWithFont(ByVal sText As String, ByVal oFont As Font) For Each cControl In frmMain.Controls If

    0熱度

    1回答

    如何返回IEnumerator的SortedDictionary(Of Integer, MyClass) 我有這個。 Dim dictionaryTest As New SortedDictionary(Of Integer, MyClass) Dim enumerator As IEnumerator(Of Integer, MyClass) = dictionaryTest.GetEnum

    1熱度

    2回答

    我需要了解下面的由其他人編寫的java腳本代碼。 你能告訴我下面的行是什麼意思(特別是第四行)。 這是一個單一的冗長的線(直到;)。 這不是一個難題。 這是一個購物應用程序的代碼,實際上正在使用(未更改)。 function trackMetrics(a,b,c,d) { var e=a,f=b,g=c,h=d; typeof a=="object"&&(a.type!=nu

    -1熱度

    5回答

    我需要了解一些澄清: 是/隨着運營商 出/ ref參數改性劑 typeof 隨意只回復你知道的或你想回復的內容,如果你不喜歡的話,不要回答整個問題。 是的,我問這些澄清。糾正我或增加我已經說過的話。 嗯,我GOOGLE了一下,落在了各種網站上,MSDN等。我仍然需要一些人寫一些代碼來幫助我澄清整個概念,並最終讓我充分利用它,希望這對其他人也有幫助。 基本上這就是我理解的: A)是 在僞 如果對象是

    0熱度

    4回答

    我想知道是否有經典的替代品。 if (typeof firstPost === 'object' && typeof firstPost.active === 'boolean' && typeof firstPost.message === 'string' && typeof firstPost.maxHeight) 爲了避免編寫更多的代碼,可能會循環對象。

    3熱度

    3回答

    我寫在平原Ç以下代碼: #define _cat(A, B) A ## _ ## B #define cat(A, B) _cat(A, B) #define plus(A, B) cat(cat(plus,__typeof__(A)),__typeof__(B))(A, B) int main(int argc, const char * argv[]) { double x

    0熱度

    1回答

    對不起,如果以不同的方式提出了這個問題。基本上我必須寫這個: (window.name ="xyz" && ahdframeset == ahdtop && typeof window.parent.ahdframe.frames == "object" && typeof window.parent.ahdframe.frames [window.name] == "undefin