Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Win 32 console application Pin
Cedric Moonen8-Feb-07 4:14
Cedric Moonen8-Feb-07 4:14 
QuestionTo get filename as input Pin
siddharthsan7-Feb-07 19:39
siddharthsan7-Feb-07 19:39 
AnswerRe: To get filename as input Pin
Waldermort7-Feb-07 19:44
Waldermort7-Feb-07 19:44 
AnswerRe: To get filename as input Pin
Hamid_RT7-Feb-07 20:07
Hamid_RT7-Feb-07 20:07 
QuestionRe: To get filename as input Pin
David Crow8-Feb-07 3:49
David Crow8-Feb-07 3:49 
Questionproblems in binding INADDR_ANY Pin
mpk19797-Feb-07 19:19
mpk19797-Feb-07 19:19 
AnswerRe: problems in binding INADDR_ANY Pin
Mark Salsbery8-Feb-07 6:15
Mark Salsbery8-Feb-07 6:15 
QuestionFind Algorithm [STL] Pin
Astricks7-Feb-07 18:52
Astricks7-Feb-07 18:52 
Please consider this example:

#include <vector>  
#include <list>	   
#include <algorithm>	   
using namespace std;
...
list <int>  nums;
list <int> ::iterator nums_iter;

nums.push_back (3);
nums.push_back (7);
nums.push_front (10);

nums_iter = find(nums.begin(), nums.end(), 3); // Search the list.

if (nums_iter != nums.end())
{
    cout << "Number " << (*nums_iter) << " found." << endl; // 3
}
else
{
    cout << "Number not found." << endl;



}

Here the elements are of type "int". So we can directly make a "find". But what if the pushed elements are objects? or struct variables?
for example:
typedef struct myStruct
{
 int x;
 int y;
}myStruct_t 

myStruct_t mySObj; mySObj.x=10;mySObj.y=20;

list <myStruct_t> lst_mySObj;
//Push a lot of mySobj into lst_mySObj list.

list <myStruct_t>::iterator mySObj_iter;

How do I do the rest of the rest of the things?
Like this :???
mySObj_iter = find(lst_mySObj.begin(), lst_mySObj.end(),mySObj.x );
Not sure Unsure | :~

*

AnswerRe: Find Algorithm [STL] Pin
prasad_som7-Feb-07 19:22
prasad_som7-Feb-07 19:22 
GeneralRe: Find Algorithm [STL] Pin
Astricks7-Feb-07 19:42
Astricks7-Feb-07 19:42 
GeneralRe: Find Algorithm [STL] Pin
Waldermort7-Feb-07 19:46
Waldermort7-Feb-07 19:46 
GeneralRe: Find Algorithm [STL] Pin
Astricks7-Feb-07 19:49
Astricks7-Feb-07 19:49 
GeneralRe: Find Algorithm [STL] Pin
Waldermort7-Feb-07 19:54
Waldermort7-Feb-07 19:54 
GeneralDoesn't work still Pin
Astricks7-Feb-07 20:08
Astricks7-Feb-07 20:08 
AnswerRe: Find Algorithm [STL] Pin
prasad_som7-Feb-07 20:12
prasad_som7-Feb-07 20:12 
GeneralRe: Find Algorithm [STL] Pin
Astricks7-Feb-07 20:18
Astricks7-Feb-07 20:18 
GeneralRe: Find Algorithm [STL] Pin
Waldermort7-Feb-07 21:08
Waldermort7-Feb-07 21:08 
QuestionEnumerate Menu Items of MS-Office Apps [modified] Pin
San24687-Feb-07 18:48
San24687-Feb-07 18:48 
QuestionWhy __cdecl Calling convention set to be Default compare to _stdcall. [modified] Pin
Kotesh.N7-Feb-07 18:29
Kotesh.N7-Feb-07 18:29 
AnswerRe: Why __cdecl Calling convention set to be Default. Pin
ThatsAlok7-Feb-07 20:03
ThatsAlok7-Feb-07 20:03 
Questionsave a text file Pin
Siddam7-Feb-07 18:12
Siddam7-Feb-07 18:12 
AnswerRe: save a text file Pin
Ravi Bhavnani7-Feb-07 18:15
professionalRavi Bhavnani7-Feb-07 18:15 
GeneralRe: save a text file Pin
Hamid_RT7-Feb-07 18:23
Hamid_RT7-Feb-07 18:23 
AnswerRe: save a text file Pin
Siddam7-Feb-07 19:19
Siddam7-Feb-07 19:19 
AnswerRe: save a text file Pin
prasad_som7-Feb-07 19:28
prasad_som7-Feb-07 19:28 

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.