How can i use random and also make use of inheritance

I was trying to use random to generate random numbers but it was not going on well with me and i don't know how to do that, please help me come out of this problem. Also, i was trying to let an object inherit the properties of the base object but it was not easy for me, Please help me.
for inheritance it would look something like this:

1
2
3
4
5
6
7
8
9
class A
{
    // whatever is in this class
};

class B: public A
{
    // whatever is in this class
};


basically what that is saying is that class be will inherit everything that is in the public of the class A.

a useful article might be this one:
http://www.cplusplus.com/doc/tutorial/inheritance/

for random numbers:
http://www.cplusplus.com/reference/clibrary/cstdlib/rand/

this is a good source, if you have questions after looking at that source then feel free to ask, and someone will probably answer.

Hope this helps.
Last edited on
Topic archived. No new replies allowed.