assigning rand outputs to variables

well...im trying to assign the outputs generated by rand () to a variable so that i can multiply them later. unfortunately, i keep getting 'intializing' errors regardless of whether i try to just assign the value to a variable, or try to put the values into an array. any ideas (ive been searching through threads for about an hour!)?

You never said what random or random2 is. You have functions named random and random2, but no variables. Right there it is looking for variables, not returns from the function. The return value falls out of scope and dies right after the function exits, so you need to catch it in a real variable before trying to access it.

Code:

int randreturned = random(0,10);
cout >> randreturned;

Repeat for the second value.
then when you are trying to put it into c...

Just remember in the future. declaring a variable inside of a function creates what is called a local variable. As soon as the function exits, it is drug out back and shot on the spot. Everytime you call a function, it recreates the variables within, and everytime it exits it kills them. variable = function(parameters) is the only way to keep a return, or else it dies on the next line itself.