diff options
Diffstat (limited to '7p52.cpp')
-rw-r--r-- | 7p52.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/7p52.cpp b/7p52.cpp new file mode 100644 index 0000000..be826e7 --- /dev/null +++ b/7p52.cpp @@ -0,0 +1,27 @@ +#include <iostream> + +/* + * + * 7.52 + * + * + */ + +struct Sales_data { + std::string bookNo; + unsigned units_sold = 0; + double revenue = 0.0; +}; + +int main () { + + Sales_data item = {"978-0590353403", 25, 15.99}; + std::cout << item.bookNo << "\n" + << item.units_sold << "\n" + << item.revenue << std::endl; + + // There seems to be no issues + // Apparently it refuses to compile if we were to use C++11 + // I am currently on C++20 + return 0; +} |