New to the language and confused
-
I'm confused with booleans. If I have these kind of methods in my classes bool withdraw(float amount,Account a); bool transfer(float amount,Account s,Account c); could I still use couts and cin in my void main
I'd say your confused. So much so that I don't undestand the question. -- Where are we going? And why am I in this handbasket?
-
I'm confused with booleans. If I have these kind of methods in my classes bool withdraw(float amount,Account a); bool transfer(float amount,Account s,Account c); could I still use couts and cin in my void main
I mean can the following be done: bool Bank::withdraw(float amount,Account a); cout<<"\nEnter a positive amount for the withdrawal-$"; cin>>amount; while(amount<=0) { cout<<"\ninvalid amount"; cout<<"\nEnter a positive amount for withdrawal-$"; cin>>amount; } If there was an int or float in the place of bool I would not be so lost.
-
I'm confused with booleans. If I have these kind of methods in my classes bool withdraw(float amount,Account a); bool transfer(float amount,Account s,Account c); could I still use couts and cin in my void main
Dee wrote: could I still use couts and cin in my void main This has no connection with having a function that returns a bool. Nish
Regards, Nish Native CPian. Born and brought up on CP. With the CP blood in him.
-
I mean can the following be done: bool Bank::withdraw(float amount,Account a); cout<<"\nEnter a positive amount for the withdrawal-$"; cin>>amount; while(amount<=0) { cout<<"\ninvalid amount"; cout<<"\nEnter a positive amount for withdrawal-$"; cin>>amount; } If there was an int or float in the place of bool I would not be so lost.
bool
is just another type of variable, nothing magical about it. --Mike-- Just released - RightClick-Encrypt - Adds fast & easy file encryption to Explorer Like the Google toolbar? Then check out UltraBar, with more features & customizable search engines! My really out-of-date homepage Sonork - 100.10414 AcidHelm