I am learning c++ and not totally sure on how to insert and remove certain or all items in a list properly. This is what i am doing.
The struct
struct _STRUCT_TYPE_
{
int nReference
char[128] strAddress
};
Defining the list
std::list<_STRUCT_TYPE_> m_ListExample
Inserting into the list
_STRUCT_TYPE_ pStruct;
pStruct.nReference = nVar1;
pStruct.strAddress = strVar2
m_ListExample.push_back(pStruct);
Clearing the list
m_ListExample.clear();
Am i doing every correctly? could something better be done? i am interested.