Hello ,
I try to find the structure which is in the clist [mfc]
Code:
Struct sentence
{
int id;
CString name;
};
CList<sentence>sentenceinfo ;
sentence sRec1;
sRec1.id = 10;
sRec1name = "LONG"
sentenceinfo.addTrail(sRec1);
sentence sRec2;
sRec1.id = 20;
sRec1name = "SHORT"
sentenceinfo.addTrail(sRec2);
here I want to check whether the id and name are existing in the structure.
sentence tmpRec:
tmpRec.id = 10;
tmpRec.name = "SHORT "
For example
Is it possible to check like this
If(sentenceinfo.Find(tmpRec ) == NULL)
sentenceinfo.AddTrail(tmpRec);
else
Already exist.
Since I don't have system I could not check and on the way to my office. If you could suggest me on this, It will be useful.
Thank you