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]
newbie: deleting dynamic arrays??
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
Popular Topics
Advertisement
Recommended Tutorials
Advertisement