Home

I have a basic C++ question. Consider a composite class A containing
two data members B and C that are also class objects:

class A
{
private:
B objB; // B is a class
C objC; // C is class
public:
...etc...
}

Is there a way for objB to invoke a method defined in class C? For
instance,

void B::functionB(void)
{
objC.functionC(void);
}

What is the best way to "link" B and C?

Thanks.

previous
next

Enum class with ToString functionality
Re: ensuring GNU readline isn't used
Re: overloaded assignment operator and copy constructor.
understanding of data abstraction, information hiding and encapsulation
Re: Cleanup Technique
Fundacja Iskierka
Rodzic Po Ludzku
Mam Marzenie
Fundacja Avalon
Krwinka