
As a webmaster, I do a lot of research on the web. This requires many different tools to manage links, content, and domains (of course, my favorite is Pioneer Report ;)). One important task is search engine research. It involves comparing one list of links with another, different list.
It is easy to find software which makes a list or takes a list. But, what if you want to compare two lists? What if you want to know what are the common elements to each list? How about knowing what is in one list, but not in another, and eliminating all the duplicates?
This code solves this problem.
int CBigFinderDlg::AnotB(CString& sBody) { std::map<CSTRING, int>::iterator <CODE>it; intnResultsCount= 0; for (it=m_aMap.begin(); it !=m_aMap.end();it++) { std::map::iterator itb; BOOLbSkip= false; for (itb=m_bMap.begin();itb!=m_bMap.end();itb++) { if (it->first ==itb->first) {bSkip= true; break; } } if (!bSkip) { if (nResultsCount> 0)sBody+= "\r\n";sBody+=it->first;nResultsCount++; } } returnnResultsCount; }
| You must Sign In to use this message board. | ||||||
|
||||||
|
||||||
|
||||||