Click here to Skip to main content
15,921,250 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to detect the socket was blocked? Pin
LaHaHa9-Nov-06 20:56
LaHaHa9-Nov-06 20:56 
AnswerRe: How to detect the socket was blocked? Pin
Moak18-Dec-06 5:42
Moak18-Dec-06 5:42 
QuestionFinding number of occurences in a list of numbers Pin
Jay039-Nov-06 19:57
Jay039-Nov-06 19:57 
AnswerRe: Finding number of occurences in a list of numbers Pin
XtremDev9-Nov-06 20:28
XtremDev9-Nov-06 20:28 
GeneralRe: Finding number of occurences in a list of numbers Pin
Anthony Mushrow9-Nov-06 23:41
professionalAnthony Mushrow9-Nov-06 23:41 
GeneralRe: Finding number of occurences in a list of numbers Pin
jhwurmbach10-Nov-06 2:29
jhwurmbach10-Nov-06 2:29 
AnswerRe: Finding number of occurences in a list of numbers Pin
Michael Dunn9-Nov-06 22:56
sitebuilderMichael Dunn9-Nov-06 22:56 
AnswerRe: Finding number of occurences in a list of numbers [modified] Pin
Anthony Mushrow9-Nov-06 23:38
professionalAnthony Mushrow9-Nov-06 23:38 
Make a new array for the initial list of numbers then
use a for loop to start adding the numbers to the array, use an embedded for loop to check whether the number has already been added.

for(int i=0; l <7; i++) {<br />
<br />
		list[i].number = 0;<br />
		list[i].occurences = 0;<br />
<br />
	}<br />
	int ListIndex = 0;<br />
<br />
	for(i=0; i <7; i++) {<br />
		<br />
		int index = i;<br />
		bool IsRepeat = false;<br />
	<br />
		for(int j=0; j <7; j++) {<br />
<br />
			if(array[index] == list[j].number) {<br />
<br />
				IsRepeat = true;<br />
				list[j].occurences++;<br />
			}<br />
		}<br />
		<br />
		if(!IsRepeat) {<br />
			<br />
			list[ListIndex].number = array[i];<br />
			list[ListIndex].occurences = 1;<br />
			ListIndex++;<br />
		}<br />
	}


I just stuck that togeather now, if it don't work, then don't complain about it Poke tongue | ;-P


-- modified at 6:27 Friday 10th November, 2006
The code does work, im so happy Smile | :)
GeneralRe: Finding number of occurences in a list of numbers Pin
Jay0310-Nov-06 8:05
Jay0310-Nov-06 8:05 
GeneralRe: Finding number of occurences in a list of numbers Pin
Anthony Mushrow10-Nov-06 15:33
professionalAnthony Mushrow10-Nov-06 15:33 
Questionloading bitmap to dialog Pin
Sunshine Always9-Nov-06 19:51
Sunshine Always9-Nov-06 19:51 
AnswerRe: loading bitmap to dialog Pin
Christian Graus9-Nov-06 20:00
protectorChristian Graus9-Nov-06 20:00 
GeneralRe: loading bitmap to dialog Pin
Sunshine Always9-Nov-06 20:09
Sunshine Always9-Nov-06 20:09 
GeneralRe: loading bitmap to dialog Pin
Monty29-Nov-06 20:33
Monty29-Nov-06 20:33 
GeneralRe: loading bitmap to dialog Pin
Sunshine Always9-Nov-06 21:19
Sunshine Always9-Nov-06 21:19 
GeneralRe: loading bitmap to dialog Pin
Monty29-Nov-06 21:25
Monty29-Nov-06 21:25 
GeneralRe: loading bitmap to dialog Pin
Sunshine Always9-Nov-06 21:58
Sunshine Always9-Nov-06 21:58 
GeneralRe: loading bitmap to dialog Pin
Sunshine Always9-Nov-06 23:04
Sunshine Always9-Nov-06 23:04 
AnswerRe: loading bitmap to dialog Pin
Hamid_RT9-Nov-06 20:00
Hamid_RT9-Nov-06 20:00 
GeneralRe: loading bitmap to dialog Pin
Sunshine Always9-Nov-06 20:11
Sunshine Always9-Nov-06 20:11 
GeneralRe: loading bitmap to dialog Pin
Hamid_RT9-Nov-06 21:04
Hamid_RT9-Nov-06 21:04 
QuestionDebugging Service Pin
mpk19799-Nov-06 19:26
mpk19799-Nov-06 19:26 
AnswerRe: Debugging Service Pin
dharani9-Nov-06 19:47
dharani9-Nov-06 19:47 
AnswerRe: Debugging Service Pin
karle10-Nov-06 9:20
karle10-Nov-06 9:20 
QuestionHow to Create hooks in VC++? Pin
gloriousgopi9-Nov-06 19:09
gloriousgopi9-Nov-06 19:09 

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.