C++Primer Fifth Edition: Exercise 2.39 2.40

练习2.39
return type of ‘main’ should be ‘int’ instead of ‘Foo’
expected a ‘:’
‘Foo’ followed by ‘int’ is illegal(did you forget a ‘:’?)

Exercise 2.40

#include<iostream>

struct Sales_data
{
    
    
    std::string bookNo;
    unsigned units_sold = 0;
    double price = 0.0;
    double revenue = 0.0
};

Guess you like

Origin blog.csdn.net/Xgggcalled/article/details/108960852