I have one doubt. I have one object list with some data (in this case to store names).
I iterate the list: (pNames it is my list receive by parameter)
std::string names;
std::list<Names>::const_iterator it = pNames->begin();
while(it != pNames->end())
{
std::cout << names << it->namesUser;
++it;
}
The problem: I need to save the all values of iterator in std::string to use this string on mysql query (for example select age from users where names in ('names');) In this momment with the `std::cout << names << it->namesUser; i can see all names in list but i cannot use the names variable in query for example. It only work with cout. I'm new with c++ programming, so what is the way to store all iterator values in string?
Thanks a lot.
Regards
names += it->namesUser;in the loop?