C++12.4.2.기본 실제 참여 구조 함수

1379 단어 실제 인삼묵인
Sale_item(const std::string &book):isbn(book),units_sold(0),revenue(0.0)}{}
Sale_item():units_sold(0),revenue(0.0){}
//    isbn        ,    string           isbn
class Sale_item{
public:
   Sale_item(const std::string &book=" "):isbn(book),units_sold(0),revenue(0.0)}{}
   Sale_item(std::istream &is);
};

Sale_item first_item(cin);//         
int main()
{
Sale_item next;//         ,isbn      ,units_sold    0,revenue    0.0
Sale_item last("9-999-9999-9");//         ,isbn    9-999-9999-9,units_sold    0,revenue    0.0
}

좋은 웹페이지 즐겨찾기