Re: [need help] Initializing Objects in Control Structures
For sure but it seemed to me, that he wanted to use the "some.function" outside the local scopes of the if statements while initializing objects there.
So I tried to give him such a solution.
Re: [need help] Initializing Objects in Control Structures
Your problem is that the account objects are going out of scope when the if statement ends and their destructor's are being called. Initialized it outside of the if else statement and then just modify it as needed in the if statements. If you don't know what I mean by going out of scope just do a quick Google search. This is something every programmer should know about.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.