Dynamically Create A New Class With Pointers (Polymorphism)

Mar 6, 2016 at 7:35pm
g
Last edited on Mar 7, 2016 at 12:33am
Mar 6, 2016 at 10:00pm
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).
Mar 7, 2016 at 12:10am
> 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.