Answers for "istream c++"

C++
-1

istream c++

//These functions can access the private data of the class that declared them to be friends!
	 std::istream& operator>>(std::istream& ist, Book& b){
		 ist >> b.price >> b.title >> b.author;
		 return ist;
	 }
	 std::ostream& operator<<(std::ostream& ostr, const Book& b){
		 ostr << "Title: " << b.title << "   Autor: " << b.author << "   Price: "<< b.price ; 
		 return ostr;
	 }
Posted by: Guest on September-26-2021

Browse Popular Code Answers by Language