表示機能が動作しない理由がわかりません。私のcout
声明は次のようなことを述べています
no match for operator << in std :: cout<<n->movieinventory::movienode::m
何か案は?
class MovieInventory
{
private:
struct MovieNode // the Nodes of the linked list
{
Movie m; // data is a movie
MovieNode *next; // points to next node in list
};
MovieNode *movieList; // the head pointer
bool removeOne(Movie); // local func, used by sort and removeMovie
public:
MovieInventory();
bool addMovie(Movie);
int removeMovie(Movie);
void showInventory();
Movie findMinimum(); // should be private, but public for testing
void sortInventory();
int getTotalQuantity();
float getTotalPrice();
};
表示コード:
void MovieInventory::showInventory()
{
MovieNode *n;
for (n = movieList; n != NULL; n = n->next)
cout << n->m;
}