Why does 0 become 1 sometime ?
Add a Print statement inside setStopLoss and you will see that the method is called after orderInfo.setStopLoss( 0 ) and before m_orderInfo.getStopLoss().
Run it under the debugger with a break point on the return. Find out where.
I have this class OrderInfo
Why is it if I use
orderInfo = new OrderInfo() ;
orderInfo.setStopLoss( 0 ) ;
Then I pass the OrderInfo object to other object from class Executioner
executioner.setOrderInfo ( orderInfo ) ;
Definition of function setOrderInfo in class Executioner:
public void setOrderInfo( OrderInfo* _orderInfo ) { m_orderInfo = _orderInfo ; }
Inside one of the method of object Executioner:
public void functiona()
{
Print( "Stop loss is: " + m_orderInfo.getStopLoss() ) ; // its 1 not 0
}