Hello Everyone. I am having trouble creating new objects in a loop.
I am using:
DataType *Ptr = new DataType ();
I use this in the beggining of the loop then end the loop with:
delete Ptr;
Each constructor and destructor gets called each time the loop is executed.... but for some reason the constructor is not seeding correctly. I have the Class constructor to be:
1. DataType:: DataType ()
2. {
3. srand(time(0));
4. }
Which is to have a different seed when the constructor is called and give different sets of random numbers. For some reason it seems that every time the constructor is called in the While Loop it generates the same random numbers, which makes me think that my constructor is giving me the same seed.
If anyone can help I can provide the full code if needed. Thanks for any assistance.