If I had the following two options, which would be more desirable or generally accepted.
1. Creating an object on the stack and returning it by value.
2. Creating an object on the heap, storing...
Type: Posts; User: mrpringle
If I had the following two options, which would be more desirable or generally accepted.
1. Creating an object on the stack and returning it by value.
2. Creating an object on the heap, storing...
Thanks for the help. I will need to read up on how iterators work.
How is something like this done?
I'll try and simplify my example.
Let's say there is a class Canvas which has a vector of shapes.
class Canvas
{
public:
addShape(const Shape &shape);
Hi,
I'm trying to learn how to use C++ properly and I've run into a dilemma.
If I have a class which has a private vector and I want to allow a client of this class to iterate over the objects in...