Monday, December 12, 2011

Problem with bank account, memeber variables?

Hi I have a roblem with my C++ code, I am writing a banck account class with its derived classes(saving, checking and VIP). there is a memeber variable transaction that I want to initialize it with zero when I start each class. the problem is that I think I'm not initializing it in a right way. How should I do that.(so each time that it doeas deposit and withdraw it would be transaction++)








Thanks,


Shahrzad|||what do u mean by each class starts? each instance of the class; put transaction = 0 in the constructor. otherwize u can make transaction as a static variable and use a static block to initialize it.|||It could be a problem later on or one with your initializing. Can you explain it a bit more thouroughly? Here's my email; I'll try to help: crachedkelpie@yahoo.com

No comments:

Post a Comment