I figured it would probably help more if I posted the physical code on here for help. The idea behind it is that this is a random number generator that chooses loot for players. The program works until I try to loop it, in which it spits out the exact same numbers. Can anyone help me with this? This code is showing up until the first random number generator.
Make sure that you only call srand() once. Then you can put the rest of the code in a loop. If you call srand() again within the same second, then it re-seeds the random number generator with the same value (because time() returns the same value). That means that the next call to rand() will return the same value.
Can you post an example of the looping code that's giving the wrong answer?
Also, that code you linked to is huge. Consider putting the data in a file, then have your program read the file and act on it. For example, each line of the file might contain the D10 value, the weapon value, and the message to print.
I alreayd gave the answer and his code works fine now. Im not sure why he would post the identical question both in general and beginner. Either way, Its been answered in the general section.