I want to initialise an object inside a method.
My code:
void OnTick()
{
CBullishTrend *Bullish=NULL;
CalcBullish(Bullish);
}
void CalcBullish(CBullishTrend &pBullish)
{
pBullish = new CBullishTrend(ColorForBullishTrend);
// do calculations
}
I get this compile error:
'=' - object required
I can only pass objects by reference, so why am I getting this compile error?
Any help would be greatly appreciated.
i think what u are trying to do is pass reference to a pointer, like so:
void CalcBullish(CBullishTrend *&pBullish)