I have this function
1 2 3 4 5 6 7 8
|
std::vector <vector<std::string> > W_win::memories () {
std::vector <vector<std::string> > provector;
cProcesses = 100;
provector.resize(cProcesses);
for (int i = 0; i < cProcesses; ++i)
provector[i].resize(10);
return provector;
}
|
I also have
1 2 3
|
void W_win::memory_use (std::vector <vector<string> > datamemori) {
datamemori = memories();
W_debug()<<"capacity 1"<<datamemori.capacity()<<"";
|
}
OK, I call memory_use from the main class in this way:
1 2 3
|
std::vector <vector<std::string> > apps;
W_win().memory_use(apps);
W_debug()<<"capacity 2 "<<apps.capacity()<<"";
|
Ok, I have :
Capacity 1 = 45;
Capacity 2 = 0;
Can anyone help me ? What happens, I loose the vector data ....
I'm imagine is a question about pointers or references , isn't ?
Thanks
Last edited on
Ok, thanks.
And passing a pointer is faster ?