I wrote a program using inheritance. Two classes (aDie and aCoin) inherate from
ID: 3619546 • Letter: I
Question
I wrote a program using inheritance. Two classes (aDie and aCoin) inherate from my random number generator class. I am getting the same compiler error for each class. They occur when I create my object and pass the seed value to my constructor. Any help fixing this problem is appreciated. I have a feeling it is a simple fix but can't see it.errors:
error c2664 aDie::aDie(const aDie &): cannot convert parameter 1 from "int" to "const aDie &"
error c2664 aCoin::aCoin(const aCoin &): cannot convert parameter 1 from "int" to "const aCoin &"
code:main
cout << "Enter a seed number: "; // promp for user to enter a seed number
cin >> n;
cout << endl;
cout << endl;
aRandomNumberGenerator number(n);//
aDie die(n);
aCoin coin(n);
code: derived classes
// constructor
aDie::aDie(int num, int t)
: aRandomNumberGenerator( num )
{
seed(t);
}
// constructor
aCoin::aCoin(int num, int s)
: aRandomNumberGenerator( num )
{
seed(s);
}