我只是想从ArrayBag类继承公共成员函数,但我一直收到此“预期的类名”错误。我已包含文件并检查了拼写,但是错误仍然存在。我还确保在使用它们的地方包含适当的头文件。
$ra
#ifndef _ZOORECORD_HPP_
#define _ZOORECORD_HPP_
#include "ArrayBag.hpp"
#include "Animal.hpp"
#include <fstream>
#include <string>
class ZooRecord : public ArrayBag
{
public:
// default constructor
ZooRecord();
/**
parameterized constructor
@pre the input file is expected to be in CSV
(comma separated value) format as:
"animal_name,hair,feathers,eggs,milk,airborne,aquatic,predator,toothed,
backbone,breathes,venomous,fins,legs,tail,domestic,catsize,class_type\n"
@param input_file_name the name of the input file
@post adds Animal objects to record as per the data in the input file
**/
ZooRecord(std::string input_file_name);
/**
@post displays all animals in record, one per line by calling animal's
display method”
**/
void display();
};
#endif