Great!! That worked. I kind of feel stupid. I should have seen it.
list< Coordinate >::const_iterator iter;
iter = listRef.begin();
Type: Posts; User: figa
Great!! That worked. I kind of feel stupid. I should have seen it.
list< Coordinate >::const_iterator iter;
iter = listRef.begin();
Few more questions:
First:
So does that means that the destructor would then take care of deleting the object and freeing up the memory once the object is removed from the list?
Second:
...
So I guess that dynamically creates the new nodes, right? Cool. that is eaven easier.
Thanks.
Hey thanks for your quick reply, it helped a lot. Some times it takes a second person to point out the obvious, like the fact that I was not pushing actual objects. Dope!!
Thanks again, and here...
If been trying to use the STL list with my own class, to make up nodes.
In other words, what I am trying to do is that instead of just pushing in just an integer or a character for example, I want...
Oh cool!!. That is what I was doing wrong. and also I did not had the using namespace std in the file. Thank you both a lot.
Figa
I tried that, but this is the error whenever I compile that way:
lab35->g++ test.cpp
/tmp/ccWqOfOU.o(.text+0x1d): In function `main':
: undefined reference to `Point::set_x(int)'...
I took c++ a long time ago in school, now I am trying to relearn everything again. I think this is a very stupid question but I don't care, here it goes:
//test.cpp
#include "point.h"
...