Hi, this is what i'm trying to do
class a
{
private:
string attribute;
string p_msg;
public:
string& getAttribute()
{
return attribute;
}
};
above is the class, i want to call function getAttribute() from
class a is a linked list: list<a*> aa
void sortFile(Manager& manage, const char* file)
{
string text, Id;
text = file;
Id = text.substr (0, 2);
a* aa; //i'm trying to make object of class a >.<
aa.getAttribute() = Id; //this line doesn't work, I'm trying to assign
attribute from getAttribute() to var Id.
}
this is the error message:
In function `void sortFile(Manager& manage, const char* file)':
`getPacketID' has not been declared
request for member of non-aggregate type before '(' token
what did I do wrong?