Accessing methods of an object put inside a class

Posted by Klaus on Stack Overflow See other posts from Stack Overflow or by Klaus
Published on 2010-05-15T21:04:35Z Indexed on 2010/05/15 21:14 UTC
Read the original article Hit count: 129

Filed under:
|
|

Hello,

A class A possesses an instance c of a class C. Another class B has to modify c through C::setBlah(); method.

Is it bad to create an accessor C getC(); in A and then use A.getC().setBlah() ?

Or should I create a method A::setBlah(); that would call C::setBlah(); ? Isn't it annoying if there are several methods like that ?

© Stack Overflow or respective owner

Related posts about c++

Related posts about attributes