简体   繁体   English

没有课程类型

[英]does not have class type

Trying to iterate through a vector in a class in C++ using: 尝试使用以下方法在C ++中的类中遍历向量:

for(vector<Album>::iterator it = a.getAlbumList.begin(); it != a.getAlbumList.end(); it++)

yet it gives me the error: 却给了我错误:

error: 'a.AlbumCollection::getAlbumList' does not have class type 错误:“ a.AlbumCollection :: getAlbumList”没有类类型

This is frustrating me as I have no idea what this means, and I have tried to follow other suggestions but to no help. 这让我感到沮丧,因为我不知道这意味着什么,而且我尝试遵循其他建议,但没有帮助。 I'm only just a beginner, so if some one could explain this to me simply that would be great thanks. 我只是一个初学者,所以如果有人可以向我简单地解释一下,那将非常感谢。

Here is the class: 这是课程:
.cpp: http://pastebin.com/MSCcHjXb .cpp: http//pastebin.com/MSCcHjXb
.h: http://pastebin.com/Xq4nqSan .h: http//pastebin.com/Xq4nqSan

You (apparently) want to call the getAlbumList member function, so your code should be: 您(显然)想调用 getAlbumList成员函数,因此您的代码应为:

for(vector<Album>::iterator it = a.getAlbumList().begin(); 
                            it != a.getAlbumList().end(); 
                            it++)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM