title: String ^ MyString = gcnew String("abcd");
body: <p>I was reading the c++'s <a href="https://msdn.microsoft.com/en-us/library/ms177202.aspx" rel="nofollow noreferrer">foreach</a> syntax on MSDN:</p>
  
  <pre><code>// for_each_string1.cpp  
  // compile with: /ZW  
  #include &lt;stdio.h&gt;  
  using namespace Platform;  
  
  ref struct MyClass {  
     property String^ MyStringProperty;  
  };  
  
  int main() {  
     String^ MyString = ref new String("abcd");  
  
     for each ( char c in MyString )  
        wprintf("%c", c);  
  
     wprintf("/n");  
  
     MyClass^ x = ref new MyClass();  
     x-&gt;MyStringProperty = "Testing";  
  
     for each( char c in x-&gt;MyStringProperty )  
        wprintf("%c", c);  
  }
  </code></pre>
  
  <p>I tried to find what the "^" means on google but I couldn't find anything (or my query wasn't correct)</p>
  
  <p>What does it mean? Is it as a "*"? Is it as a "&amp;"?   </p>
  
  <p>This syntax also applies to C#. Do they mean the same thing in both languages?</p>
  
  <p>Piece of C# <a href="https://blogs.msdn.microsoft.com/arich/2004/09/08/the-c-for-each-syntax/" rel="nofollow noreferrer">code</a>:</p>
  
  <pre><code>using namespace System;
  
  int main(){
    array&lt;int&gt;^ arr = gcnew array&lt;int&gt;{0,1,2,5,7,8,11};
    int even=0, odd=0;
  
    for each (int i in arr) {
      if (i%2 == 0)  
        even++;      
      else 
        odd++;         
    }
  
    Console::WriteLine(“Found {0} Odd Numbers, and {1} Even Numbers.”,
      odd, even);
  }
  </code></pre>