Click here to Skip to main content
15,920,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: convert from size_t to unsigned int Pin
Stephen Hewitt29-Jul-07 15:06
Stephen Hewitt29-Jul-07 15:06 
GeneralRe: convert from size_t to unsigned int Pin
George_George29-Jul-07 18:24
George_George29-Jul-07 18:24 
GeneralRe: convert from size_t to unsigned int Pin
Stephen Hewitt29-Jul-07 18:26
Stephen Hewitt29-Jul-07 18:26 
GeneralRe: convert from size_t to unsigned int Pin
George_George29-Jul-07 18:57
George_George29-Jul-07 18:57 
QuestionHow to search a value of a variable of an object in a list of objects Pin
beriho27-Jul-07 20:24
beriho27-Jul-07 20:24 
AnswerRe: How to search a value of a variable of an object in a list of objects Pin
Christian Graus27-Jul-07 20:41
protectorChristian Graus27-Jul-07 20:41 
GeneralRe: How to search a value of a variable of an object in a list of objects [modified] Pin
beriho27-Jul-07 20:58
beriho27-Jul-07 20:58 
AnswerRe: How to search a value of a variable of an object in a list of objects Pin
Eytukan28-Jul-07 5:18
Eytukan28-Jul-07 5:18 
You should overload the == operator and use the find algorithm.
<br />
class cObj<br />
{<br />
	int objNum;<br />
        string objName;<br />

Below,you can actually have the int type as well that you can check for your "2" directly than passing it from an object. But in case you want to change the search condition sometime later, this doesnt help. Better pass the object and get the member from it.
<br />
	bool operator == (const cObjSent)//int here if you want<br />
	{  <br />
		return ((objNum==cObjSent.objNum));<br />
	}<br />
}<br />
<br />
void main()<br />
{<br />
list <cObj> cObjObject;<br />
list <cObj> ::iterator cObj_iter;<br />
<br />
cObj_iter = find(cObjObject.begin(), cObjObject.end(), YOUR_COBJ_SEARCHOBJECT_HERE 
[Like for eg:your obj2]
);<br />
<br />
//cObj_iter has the result.<br />
}<br />
<br />






He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.

-Marc Clifton.

Best wishes to Rexx[^

GeneralRe: How to search a value of a variable of an object in a list of objects Pin
beriho28-Jul-07 6:22
beriho28-Jul-07 6:22 
QuestionProgress bar in list ctrl Pin
neha.agarwal2727-Jul-07 19:31
neha.agarwal2727-Jul-07 19:31 
AnswerRe: Progress bar in list ctrl Pin
SandipG 30-Jul-07 1:51
SandipG 30-Jul-07 1:51 
AnswerRe: Progress bar in list ctrl Pin
Hamid_RT31-Jul-07 21:06
Hamid_RT31-Jul-07 21:06 
Questionhow to print with commas.. Pin
dalmar mahamoud27-Jul-07 19:02
dalmar mahamoud27-Jul-07 19:02 
AnswerRe: how to print with commas.. Pin
Paul Conrad27-Jul-07 19:38
professionalPaul Conrad27-Jul-07 19:38 
QuestionJust curious. Pin
dellthinker27-Jul-07 15:32
dellthinker27-Jul-07 15:32 
AnswerRe: Just curious. Pin
codemunkeh27-Jul-07 16:14
codemunkeh27-Jul-07 16:14 
GeneralRe: Just curious. Pin
Paul Conrad27-Jul-07 19:40
professionalPaul Conrad27-Jul-07 19:40 
AnswerRe: Just curious. Pin
John R. Shaw28-Jul-07 0:22
John R. Shaw28-Jul-07 0:22 
GeneralRe: Just curious. Pin
codemunkeh28-Jul-07 13:44
codemunkeh28-Jul-07 13:44 
Questionforward deklaration Pin
zqueezy27-Jul-07 11:12
zqueezy27-Jul-07 11:12 
AnswerRe: forward deklaration Pin
DevMentor.org27-Jul-07 11:18
DevMentor.org27-Jul-07 11:18 
GeneralRe: forward deklaration Pin
zqueezy27-Jul-07 11:21
zqueezy27-Jul-07 11:21 
AnswerRe: forward deklaration Pin
Bartosz Bien27-Jul-07 11:19
Bartosz Bien27-Jul-07 11:19 
GeneralRe: forward deklaration Pin
DevMentor.org27-Jul-07 11:24
DevMentor.org27-Jul-07 11:24 
GeneralRe: forward deklaration Pin
zqueezy27-Jul-07 11:26
zqueezy27-Jul-07 11:26 

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.