battle system

timmay i've been trying to create a battle system on c++ that i could use for sci but im not sure how to go about this...
at first i started with a ramdom number gen for the damage of the attack but once it creates a number how would you have it save or remeber it so when you attack the second time it would add the first, then check to see if its 0.
would i need to create a int that equals the number gen or is there another way?
:) later