0

what are nested classes?
and flush program and poker program .. using a suitable program ..kindly tell me??

Edited by Abhinisha

3
Contributors
4
Replies
37
Views
4 Years
Discussion Span
Last Post by rubberman
2

You did ask one question - what are nested classes? So, I will answer that. The other issues I assume are class problems, and we don't do homework...

Nested (inner) classes are classes declared/defined in the context of another (outer) class. They can be public or private to the outer class as desired. Here is an example:

class foo {
public:
    class bar {
    public:
        bar() { std::cout << "instantiating foo::bar instance" << std::endl; }
    };
    foo() { std::cout << "instantiating foo instance" << std::endl; }
    bar& getBarMember();
private:
    bar m_barmember;
};

foo::bar& foo::getBarMember()
{
    return m_barmember;
}

int main(void)
{
    foo aFooInstance;
    foo::bar& bm = aFooInstance.getBarMember();
    return 0;
}

You should get the following output when you run the program:
instantiating foo::bar instance
instantiating foo instance

Edited by rubberman

0

thankx. and i have asked for flush and poker program
but now the flush and poker program is cleared..

0

Those weren't questions... They were requests to solve a problem for you, not for help understanding the domain...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.