I'm new in programming and I'm practicing to use STL(Standard template library) against simple arrays
here I have simple codes which I wrote with simple loops and condition commands I want to convert it to STL but unfortunately, I do now which container should I use ? and how to write it. I think map container is good because it has key and value
here it is the first code :
CPOI temp(type, name,latitude, longitude,description);
if (m_noPoi<10)
{
m_POI[m_noPoi]=temp;
m_noPoi++;
}
I have a class which names CPOI and I have a condition which use arrays apart from that I want to use STL against arrays.
and here is another code :
CPOI* temp;
for (int i=0;i<m_noPoi;i++)
{
if(name==m_POI[i].getName())
{
temp=&m_POI[i];
}
}
return temp;
}
here also the story is the same I tried to use the iterator and defined 10 items like this and I think I need a for loop which iterator check it but I do not know how to implement it my idea :
vector<int> vec;
for(int m_noPoi = 0; m_noPoi < 10; m_noPoi++){
vec.push_back(m_noPoi);
}
I'll appreciate if somebody help me to develop this idea or guide me. Thanking in advance for your cooperation.