Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

昱仁
Lv 5
昱仁 asked in 電腦與網際網路程式設計 · 1 decade ago

高手救命-請問VC++ .net 2005 關於 ^ 的型態

array<Byte>^dataToEncrypt;

array<Byte>^encryptedData;

array<Byte>^decryptedData;

array<Byte>^MyStr;

String^MyPublic;

以上宣告的變數大約知道是什麼意思,可是 '^' 是什麼型態呢?!

有^和沒有^的型態不一樣,MSDN也找不到(不太會找),請問有高手能解釋一下嗎??

感恩~

ps.希望是中文資料(若是英文資料麻煩請稍為翻譯一下),因為英文看不是很懂。

問題2:

像這種'^'的問題在google搜尋之中該怎麼打呢?

(因為跑出來的搜尋結果好像都怪怪的)

誠意22點~感恩!!!!!!!!!!!!!!!!!!!!!!!!!!

Update:

那不是互次或的語法喔!!!

因為我是用在宣告!!!

2 Answers

Rating
  • 1 decade ago
    Favorite Answer

    這是宣告一個handle (pointer) to an object in managed heap.

    這種變數的使用方法和pointer一樣用"->", 例: MyPublic->Length;

    它和pointer唯一不同的地方是它的memory是由garbage collector控管的, 所以你不需要自己去deallocate它.

  • 1 decade ago

    在MSDN裡面有提到

    exclusive-OR-expression :

    AND-expression

    exclusive-OR-expression ^ AND-expression

    The bitwise-exclusive-OR operator (^) compares each bit of its first operand to the corresponding bit of its second operand. If one bit is 0 and the other bit is 1, the corresponding result bit is set to 1. Otherwise, the corresponding result bit is set to 0.

    Example

    In the following example, the bitwise-exclusive-OR operator (^) compares the bits of two integers, nNumA and nNumB:

    // Example of the bitwise-exclusive-OR operator

    int nNumA=9, nNumB=3, nNumC; // 00001001, 00000011

    nNumC = nNumA ^ nNumB; // nNumC is now 10: 00001010

    這是互斥或的語法

    要多學一下怎麼查MSDN

    Source(s): msdn
Still have questions? Get your answers by asking now.