Click here to Skip to main content
15,914,924 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Igor IP20-Dec-08 6:08
professionalIgor IP20-Dec-08 6:08 
QuestionRe: Logging stopped after CFileDialog::DoModal() invoking Pin
David Crow20-Dec-08 6:33
David Crow20-Dec-08 6:33 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Jijo.Raj20-Dec-08 8:42
Jijo.Raj20-Dec-08 8:42 
GeneralRe: Logging stopped after CFileDialog::DoModal() invoking Pin
Igor IP21-Dec-08 21:25
professionalIgor IP21-Dec-08 21:25 
Questionrandom number generation Pin
mathy20-Dec-08 2:13
mathy20-Dec-08 2:13 
AnswerRe: random number generation Pin
Jijo.Raj20-Dec-08 2:20
Jijo.Raj20-Dec-08 2:20 
AnswerRe: random number generation Pin
David Crow20-Dec-08 6:34
David Crow20-Dec-08 6:34 
GeneralRe: random number generation Pin
Luc Pattyn20-Dec-08 7:04
sitebuilderLuc Pattyn20-Dec-08 7:04 
Hi,

random and pseudo-random numbers will have some duplication, that's part of the game.
Without duplication, what would you want rand() to return once all possible values have been returned?

if you want to avoid duplication, you have to add some code to take care of that; here are two possible
approaches:

1.
keep track of earlier values, of the new number already is in that collection, create a new random number; as soon as you accept a new number, add it to the collection.

2.
beforehand, create a collection of all acceptable values; use rand() to generate an index into that
collection, return the number it points at, and remove the number from the collection.

Obviously, both these methods will fails once all acceptable numbers have been picked. But that is
what you asked for.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Fixturized forever. Confused | :confused:


AnswerRe: random number generation Pin
CPallini20-Dec-08 7:54
mveCPallini20-Dec-08 7:54 
AnswerRe: random number generation Pin
Michael Schubert20-Dec-08 13:06
Michael Schubert20-Dec-08 13:06 
QuestionProblem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.19-Dec-08 23:52
Shameer E.A.19-Dec-08 23:52 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Code-o-mat20-Dec-08 0:08
Code-o-mat20-Dec-08 0:08 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Stuart Dootson20-Dec-08 1:21
professionalStuart Dootson20-Dec-08 1:21 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.20-Dec-08 18:39
Shameer E.A.20-Dec-08 18:39 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Randor 20-Dec-08 18:54
professional Randor 20-Dec-08 18:54 
GeneralRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Shameer E.A.20-Dec-08 19:17
Shameer E.A.20-Dec-08 19:17 
AnswerRe: Problem sending data from TCP/IP server (used CAsyncSocket::Send) Pin
Randor 20-Dec-08 7:46
professional Randor 20-Dec-08 7:46 
QuestionLooking for an ADT that can sort by view (so to speak) [modified] Pin
Mustafa Ismail Mustafa19-Dec-08 20:35
Mustafa Ismail Mustafa19-Dec-08 20:35 
AnswerRe: Looking for an ADT that can sort by view (so to speak) Pin
Stuart Dootson20-Dec-08 1:00
professionalStuart Dootson20-Dec-08 1:00 
GeneralRe: Looking for an ADT that can sort by view (so to speak) Pin
Mustafa Ismail Mustafa20-Dec-08 1:21
Mustafa Ismail Mustafa20-Dec-08 1:21 
QuestionHow can change CRect Value? Pin
Le@rner19-Dec-08 20:30
Le@rner19-Dec-08 20:30 
AnswerRe: How can change CRect Value? Pin
Hamid_RT19-Dec-08 20:45
Hamid_RT19-Dec-08 20:45 
GeneralRe: How can change CRect Value? Pin
Le@rner19-Dec-08 21:04
Le@rner19-Dec-08 21:04 
GeneralRe: How can change CRect Value? Pin
Code-o-mat19-Dec-08 21:55
Code-o-mat19-Dec-08 21:55 
GeneralRe: How can change CRect Value? Pin
Le@rner19-Dec-08 23:21
Le@rner19-Dec-08 23:21 

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.