title: Check array position for null/empty
body: <p>I have an array which might contain empty/null positions (e.g: array[2]=3, array[4]=empty/unassigned). I want to check in a loop whether the array position is null. </p>
  
  <pre><code>array[4]==NULL //this doesn't work
  </code></pre>
  
  <p>I'm pretty new to C++.
  <br>Thanks.</p>
  
  <p><br> Edit: Here's more code;
  A header file contains the following declaration</p>
  
  <pre><code>int y[50];
  </code></pre>
  
  <p>The population of the array is done in another class,</p>
  
  <pre><code>geoGraph.y[x] = nums[x];
  </code></pre>
  
  <p>The array should be checked for null in the following code;</p>
  
  <pre><code>    int x=0;
      for(int i=0; i&lt;sizeof(y);i++){
          //check for null
          p[i].SetPoint(Recto.Height()-x,y[i]);
          if(i&gt;0){
              dc.MoveTo(p[i-1]);
              dc.LineTo(p[i]);
  
          }
          x+=50;
      }
  </code></pre>