istream &operator>>(istream &stream, Advertisement &a);重载>>的问题.初学者的难题.进来看看.
istream &operator>>(istream &stream, Advertisement &a);重载>>的问题.
这是对于这个函数的要求:
operator>>
This method reads an Advertisement object from an input stream. The advertisement should be input the following data members of the class in the following form.
title \n email \n quantity \n start-date \n close-date \n body \n
其中start-date,close-date是一个类.关于它的输入流重载函数已做好..
Information corresponding to the number private data member is not read from the input stream.
注意流的格式..主要是怎么样把流里面的用\n分隔掉的字符串分别赋给相应的值.