nagashre@gmail.com wrote:
Quote:
class A
{
public:
A():a(0), b(0){}
>
handleMyMsg( char* aa, char*bb);
A return value type is missing here.
Quote:
>
private:
>
processMessage();
processMessage2();
char* a;
char*b;
}
A semicolon is missing.
Both errors suggest you're not posting real C++ code. It is actually
preferable that you do post real code, otherwise we're not sure what
your problem is.
Quote:
>
Object of type A is created once and handleMyMsg is called several
times with different values for the arguments. processMessage and
processMessage2 are helper functions which needs to work on the
arguments passed to handleMyMsg.
>
Is it a bad idea to have member variables a and b which are
initialized witht he values of aa and bb every time handleMyMsg is
called?
They are not initialised. They are probably assigned some values.
It's unclear _how_ it's done (since you omitted the implemetation of
the 'handleMyMsg' function).
Quote:
In other words, is it a bad idea to have member variables which do not
have the same lifetime as the object which owns it?
No, it's not an inherently bad idea. It all depends on what you
need/use them for.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask