title: how to find out if a c++/cli heap variable has <undefined value>
body: <p>I've not been using C++ for about 4 years and came back to it a month ago, and that was where I also have first heard about the CLI extension. I still have to get used to it, but this website helps a lot! Thank you!! Anyway, I couldn't find an answer to the following problem:
  <p>
  When I declare a variable</p>
  
  <pre><code>int iStack;
  </code></pre>
  
  <p>then it is declared but not defined, so it can have any value like</p>
  
  <pre><code>iStack = -858993460
  </code></pre>
  
  <p>depending on what the value at the stack position is, where the variable is created.</p>
  
  <p>But when I declare a variable on the heap</p>
  
  <pre><code>int^ iHeap
  </code></pre>
  
  <p>then as far as I know the handle is created but the variable is not instantiated (don't know if you call it instantiation here) or defined and I can only see</p>
  
  <pre><code>iHeap = &lt;Nicht definierter Wert&gt;   (which means &lt;undefined value&gt;)
  </code></pre>
  
  <p><strong>Is there any way to detect if this value is defined?</strong><p>I particularly don't need it for int, but for example for</p>
  
  <pre><code>array&lt;array&lt;c_LocationRef^,2&gt;^&gt;^ arrTest2D_1D = gcnew array&lt;array&lt;c_LocationRef^,2&gt;^&gt;(2);
  </code></pre>
  
  <p>to find out if the elements of the outer or inner array are instantiated (I'm sure here it is an instantiation ;-) )</p>
  
  <pre><code>arrTest2D_1D = {Length=2}
     [0] = {Length=20}
     [1] = &lt;Nicht definierter Wert&gt;  (=&lt;undefined value&gt;)
  </code></pre>