Click here to Skip to main content
15,893,663 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Direct3D Types as interface parameters [modified] Pin
Aschratt21-Feb-10 4:42
Aschratt21-Feb-10 4:42 
GeneralRe: Direct3D Types as interface parameters Pin
Jonathan Davies21-Feb-10 6:23
Jonathan Davies21-Feb-10 6:23 
GeneralRe: Direct3D Types as interface parameters Pin
Aschratt21-Feb-10 6:24
Aschratt21-Feb-10 6:24 
QuestionHow to create EXE setup file using VS2005,VS2008 Pin
am 20096-Feb-10 6:14
am 20096-Feb-10 6:14 
AnswerRe: How to create EXE setup file using VS2005,VS2008 Pin
KingsGambit6-Feb-10 6:38
KingsGambit6-Feb-10 6:38 
AnswerRe: How to create EXE setup file using VS2005,VS2008 Pin
LunaticFringe6-Feb-10 7:58
LunaticFringe6-Feb-10 7:58 
Questionvector of strings, find all matches Pin
ekimpl3-Feb-10 23:54
ekimpl3-Feb-10 23:54 
AnswerRe: vector of strings, find all matches Pin
Nuri Ismail4-Feb-10 0:14
Nuri Ismail4-Feb-10 0:14 
ekimpl wrote:
'find' isn't of much use in my case, since it only returns first match.

I think that find is very useful in almost all cases (in your case too). Wink | ;)

I've modified your FindNumber function and now it works fine.
Here is the commented code:
bool FindNumber(const std::vector<sStringStruct>&v, const std::string& nString)
{
	bool found = false;
	typedef std::vector<sStringStruct> t_vec;
	sStringStruct searched_string = sStringStruct(nString);
	t_vec::const_iterator i = std::find(v.begin(), v.end(), searched_string);

	// Check if got a first match
	while(i != v.end())
	{
		// We found a match!
		found = true;

		// Print the match and search again but not the whole vector!
		// Search only in the remeaning unsearched range.
		std::cout<<"MATCH:"<<(*i).m_nString << std::endl;
		i = std::find(i+1, v.end(), searched_string);	
	}
	
	// Say if we found something or not
	return found;
}


Cheers
GeneralRe: vector of strings, find all matches Pin
ekimpl4-Feb-10 0:38
ekimpl4-Feb-10 0:38 
GeneralRe: vector of strings, find all matches Pin
Nuri Ismail4-Feb-10 3:51
Nuri Ismail4-Feb-10 3:51 
GeneralRe: vector of strings, find all matches Pin
ekimpl4-Feb-10 4:03
ekimpl4-Feb-10 4:03 
GeneralRe: vector of strings, find all matches Pin
Nuri Ismail4-Feb-10 4:07
Nuri Ismail4-Feb-10 4:07 
QuestionClient Blocking Event Sink Pin
Anthony98871-Feb-10 4:30
Anthony98871-Feb-10 4:30 
AnswerRe: Client Blocking Event Sink Pin
Stuart Dootson1-Feb-10 11:03
professionalStuart Dootson1-Feb-10 11:03 
QuestionSplitterWindow change message? [modified] Pin
Member 381982121-Jan-10 11:41
Member 381982121-Jan-10 11:41 
AnswerRe: SplitterWindow change message? Pin
Stuart Dootson21-Jan-10 22:53
professionalStuart Dootson21-Jan-10 22:53 
AnswerRe: SplitterWindow change message? Pin
Jonathan Davies22-Jan-10 2:36
Jonathan Davies22-Jan-10 2:36 
GeneralRe: SplitterWindow change message? Pin
Stuart Dootson22-Jan-10 2:51
professionalStuart Dootson22-Jan-10 2:51 
QuestionI need an ebay program Pin
totolcm13-Jan-10 2:19
totolcm13-Jan-10 2:19 
QuestionQuery to copy the table with Data and Constraints in SQL Server Pin
siddisagar6-Jan-10 0:56
siddisagar6-Jan-10 0:56 
AnswerRe: Query to copy the table with Data and Constraints in SQL Server Pin
LunaticFringe6-Jan-10 1:05
LunaticFringe6-Jan-10 1:05 
GeneralRe: Query to copy the table with Data and Constraints in SQL Server Pin
siddisagar6-Jan-10 1:12
siddisagar6-Jan-10 1:12 
GeneralRe: Query to copy the table with Data and Constraints in SQL Server Pin
LunaticFringe6-Jan-10 2:27
LunaticFringe6-Jan-10 2:27 
QuestionATL ActiveX control embedded in Internet Explorer not receiving WM_CREATE, WM_DESTROY, WM_SHOWWINDOW messages Pin
Member 455120828-Dec-09 23:55
Member 455120828-Dec-09 23:55 
QuestionProblem in transform function Pin
ashtwin16-Dec-09 1:50
ashtwin16-Dec-09 1:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.