title: Add Object to Array of Objects in C++
body: <p>There is an array of objects and to add object to it i tries the following:</p>
  
  <pre><code>Shape ShapeList[30];
  
  void addShape(Shape s)
  {
    for(int i=0; i&lt;30;i++)
    {
      if(ShapeList[i] != '\0')
          { i++;}
      else
          {
              ShapeList[i]=s;
              numShapes++;
              break;
          }
     }
  }
  </code></pre>
  
  <p><strong>numShapes</strong> is an integer variable, Shape is the class and <strong>ShapeList is the array of objects</strong>. But the compiler gives an error in this way that <code>!=</code> operator is not allowed. So how can i implement this?</p>