Dynamically Create A New Class With Pointers (Polymorphism)

g
Last edited on
In the first section of code, why all the if statements? You do the same thing after all of them. Just take out all the if statements and use a while loop(while loopTimes < 6 would work).
> Cproperty* propertyCard = new Cproperty;
¿what's the point in using pointers?
Based on your title I was expecting something like
1
2
3
4
if(property[K] == 0)
   v.push_back( new A(params) );
else
   v.push_back( new B(params) );



I don't really understand what's your question.


> Out of vector range.
http://www.cplusplus.com/forum/general/112111/
Topic archived. No new replies allowed.