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