EDIT: As per MiiNiPaa's suggestion, it is likely that you did not intend the "value" variable to be local to the function. Try something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
class Die
{
void roll() {value = rand() % 6 +1;}
int get_value() { return value; }
int value;
};
int main()
{
srand (time(NULL));
Die die1;
Die d;
int total = die1.get_value() + d.get_value();
cout << "Your initial rolls were: " << die1.get_value() << "and " << d.get_value() << "for a total of " << total;
return 0;
}