Advertisement

newbie: deleting dynamic arrays??

Started by May 13, 2002 08:51 AM
10 comments, last by werdy666 22 years, 9 months ago
quote:
Original post by dalleboy
This will not help you, but anyway:

- (jumbled == tojumble) is always false.

Fixed!

- Move the srand out of the loop, or move it out of the method entirely.

Did that too!

- The goto could be replaced by a do-while loop.
int newlocation;do{   newlocation = rand() % letters;} while (flag[newlocation] == 1);flag[newlocation] = 1;jumbled[newlocation] = tojumble[j];  


Thanks!


Another thing: Why do you have the tojumble, jumbling, flag and jumbled variables as globals when you always make new/delete on them on each call to jumble()?

ummm cause i am a beginner! lol I have moved them so they are not globals anymore.

thanks for the tips!
[edited by - dalleboy on May 13, 2002 11:20:06 AM]


You are welcome....
Arguing on the internet is like running in the Special Olympics: Even if you win, you're still retarded.[How To Ask Questions|STL Programmer's Guide|Bjarne FAQ|C++ FAQ Lite|C++ Reference|MSDN]

This topic is closed to new replies.

Advertisement