我收到错误“字符串没有命名类型”尽管有“using namespace std;”在该计划中。
#ifndef SHAPE_H
#define SHAPE_H
using namespace std;
class Shape
{
public:
Shape();
virtual ~Shape();
string getShapeName();
void setShapeName(string shapeName);
virtual float calculateArea() = 0; //Calculates area of the shape
protected:
const float PI = 3.14159265;
private:
string m_ShapeName;
};
#endif // SHAPE_H_INCLUDED
答案 0 :(得分:1)
您缺少<string>
标题:
#include <string>