c++ 入门第 5 版中的一个练习题要求编写自己的sales_data
课程版本。
我是这样做的
#include <iostream>
#include <string>
struct sales data
{
string bookno;
unsigned int books sold;
double revenue;
};
int main()
{
return 0;
}
运行它会出现以下错误:
Variable sales_data has an initializer, but an incomplete type
String was not declared in this scope (How do I declare a string?)