D
Donos
Hello
I have a program as given in following,
class CCmdValue
{
int a, b;
void Put(int x, int y) { a = x; c = y;}
};
class CCmdData
{
CCmdValue pValue;
pValue->Put(10, 20);
CCmdModule pCmd;
pCmd.NewValues(pValue);
};
class CCmdModule
{
friend class CCmdModuleFactory;
CCmdValue mValue;
};
class CCmdModuleFactory
{
CCmdModule& NewValues(CCmdValue& pValue)
{
CCmdModule* p = new CCmdModule;
p->mValue = pValue; // THIS LINE FAILS
}
};
When i try to pass the value of "pValue" to "mValue" It fails. It
doesn't give any compilation error, but when i try to read the integer
values, they don't have any vlaues assigned to them.
Any idea why thats happening?
Thanks in advance.
I have a program as given in following,
class CCmdValue
{
int a, b;
void Put(int x, int y) { a = x; c = y;}
};
class CCmdData
{
CCmdValue pValue;
pValue->Put(10, 20);
CCmdModule pCmd;
pCmd.NewValues(pValue);
};
class CCmdModule
{
friend class CCmdModuleFactory;
CCmdValue mValue;
};
class CCmdModuleFactory
{
CCmdModule& NewValues(CCmdValue& pValue)
{
CCmdModule* p = new CCmdModule;
p->mValue = pValue; // THIS LINE FAILS
}
};
When i try to pass the value of "pValue" to "mValue" It fails. It
doesn't give any compilation error, but when i try to read the integer
values, they don't have any vlaues assigned to them.
Any idea why thats happening?
Thanks in advance.