Overloading >> operator as non-member function

How would I be able to overload my >> operator with the following header:

1
2
3
4
std::istream& operator >>(std::istream& ins,Friend& f){
		//ins >> f.name >> f.bday;

	}

The inside where I have commented out is what I believed I had to do. They are private variables so I am not allowed to set them like that. Without being able to use a set_name or set_bday function, I'm unsure how to approach this.
you need to make it a friend. or add appropriate getters/setters.
Last edited on
Topic archived. No new replies allowed.