B
bahoo
Hi,
In the main function, I have
vector<vector<Store>> stores;
vector<Store> v(11);
stores.push_back(v);
and here is the Store class:
class Store
{
public:
Store();
IplImage* img;
};
Store::Store()
{
img = cvCreateImage(cvSize(512,512), IPL_DEPTH_32F, 1);
}
The strange thing is that all the 11 "v" have the same "img", with the
same address in the memory. What I wanted is of course 11 "v" with
different "img".
Can anyone spot the error?
Thanks
bahoo
In the main function, I have
vector<vector<Store>> stores;
vector<Store> v(11);
stores.push_back(v);
and here is the Store class:
class Store
{
public:
Store();
IplImage* img;
};
Store::Store()
{
img = cvCreateImage(cvSize(512,512), IPL_DEPTH_32F, 1);
}
The strange thing is that all the 11 "v" have the same "img", with the
same address in the memory. What I wanted is of course 11 "v" with
different "img".
Can anyone spot the error?
Thanks
bahoo