when i pass istream to a class function how do i use the istream that is sent?
This is what i am trying but i don't know how to use the in
Thanks for the helpCode:
void class::readinBalance (istream & in)
{
in>>var;
return;
}
Printable View
when i pass istream to a class function how do i use the istream that is sent?
This is what i am trying but i don't know how to use the in
Thanks for the helpCode:
void class::readinBalance (istream & in)
{
in>>var;
return;
}
if var is a private member of your class ( and i take it that keyword is just a placeholder) then thats fine. btw you sdont need the return; at the end of a function that returns void. Only if you are returning from the middle of the func do you need that. i.e.
void func()
{
if(something) return;
else
{
//do $$$$
}
}
That should work fine (did for me), just make a variable named var.
thanks I'm good now