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; }
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 $$$$
}
}
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
That should work fine (did for me), just make a variable named var.
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
thanks I'm good now