I am making a program with list of classes.
I have this situation that I'm not aware of how to use:
class clsMyClass {
private:
unsigned int id, nodStart, nodStop;
float pipeLen, pipeDiam;
public:
void AddElement(clsConducte element);
In another part of program I will have a variable list of this class
list <clsMyClass> pipes;
How can I make this work (with my AddEleement function) so I can write something like this
pipes.AddElement(element);
So how it will the AddElement function be defined and declared so it will work with lists?
I was thinking something like, aldo it does not work:
void clsConducte::AddElement(clsConducte element)
{
elements.push_back(element);
}
This can't work since elements variable is not defined.
Thanks