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

C / C++ / MFC

 
AnswerRe: Accessing Class Methods from other source files ? Pin
Gary R. Wheeler15-Jun-03 3:27
Gary R. Wheeler15-Jun-03 3:27 
GeneralVS .Net '02 vs VS '03 - static lib compatibility Pin
Chris Losinger14-Jun-03 6:02
professionalChris Losinger14-Jun-03 6:02 
QuestionHow to generate a random number? Pin
FlyingDancer14-Jun-03 2:38
FlyingDancer14-Jun-03 2:38 
AnswerRe: How to generate a random number? Pin
Iain Clarke, Warrior Programmer14-Jun-03 3:45
Iain Clarke, Warrior Programmer14-Jun-03 3:45 
GeneralRe: How to generate a random number? Pin
FlyingDancer14-Jun-03 3:50
FlyingDancer14-Jun-03 3:50 
GeneralRe: How to generate a random number? Pin
Hosam Aly Mahmoud14-Jun-03 5:41
Hosam Aly Mahmoud14-Jun-03 5:41 
GeneralRe: How to generate a random number? Pin
FlyingDancer14-Jun-03 15:22
FlyingDancer14-Jun-03 15:22 
GeneralRe: How to generate a random number? Pin
Iain Clarke, Warrior Programmer15-Jun-03 4:20
Iain Clarke, Warrior Programmer15-Jun-03 4:20 
This could be one of two questions:

1) How can I use the rand () function?
or
2) How can I write my own pseudo random number generator?


In answer to (1), it's quite simple. Just look up the rand function in MSDN to get the right
header file to include (stdlib.h as I remember). Then use the function which returns a pseudo
random integer. Use that as you wish...

In answer to (2), don't! There's been a LOT of brainy people doing a large amount
of work over the last several decades coming up with algorithms which return a close-to-
random number. Just use their work. For those rare examples which require a truly random
number generator (high level cryptography, weather prediction) they use a real world random
phenomenon (e.g. Cosmic ray incidence etc) and measure that.

If you can write a better random number generator than is alreay in use, you'll need more
knowledge that I can give, but you'd earn a professorship...

Iain.
AnswerRe: How to generate a random number? Pin
Ian Darling15-Jun-03 11:00
Ian Darling15-Jun-03 11:00 
GeneralGeneric C code without libraries of any kind that can be run on boot Pin
Kuniva14-Jun-03 2:12
Kuniva14-Jun-03 2:12 
GeneralRe: Generic C code without libraries of any kind that can be run on boot Pin
Ryan Binns14-Jun-03 4:30
Ryan Binns14-Jun-03 4:30 
GeneralRe: Generic C code without libraries of any kind that can be run on boot Pin
Kuniva14-Jun-03 4:46
Kuniva14-Jun-03 4:46 
QuestionHow to link the related combo box?? Pin
ShigeAris14-Jun-03 2:04
ShigeAris14-Jun-03 2:04 
AnswerRe: How to link the related combo box?? Pin
valikac14-Jun-03 6:26
valikac14-Jun-03 6:26 
GeneralRe: How to link the related combo box?? Pin
ShigeAris14-Jun-03 16:02
ShigeAris14-Jun-03 16:02 
Generalembedding fonts Pin
difa13-Jun-03 23:10
difa13-Jun-03 23:10 
GeneralRe: embedding fonts Pin
basementman16-Jun-03 4:34
basementman16-Jun-03 4:34 
GeneralRe: embedding fonts Pin
Swinefeaster13-Mar-04 13:16
Swinefeaster13-Mar-04 13:16 
GeneralON_UPDATE_COMMAND_UI wont update my menu text (in dialog based application) Pin
yccheok13-Jun-03 22:20
yccheok13-Jun-03 22:20 
GeneralRe: ON_UPDATE_COMMAND_UI wont update my menu text (in dialog based application) Pin
valikac14-Jun-03 6:29
valikac14-Jun-03 6:29 
GeneralRe: ON_UPDATE_COMMAND_UI wont update my menu text (in dialog based application) Pin
Michael Dunn14-Jun-03 6:32
sitebuilderMichael Dunn14-Jun-03 6:32 
GeneralRe: ON_UPDATE_COMMAND_UI wont update my menu text (in dialog based application) Pin
tfiner11-Apr-12 8:00
tfiner11-Apr-12 8:00 
GeneralAsynchronies dial up connection Pin
no_body6913-Jun-03 18:55
no_body6913-Jun-03 18:55 
GeneralRe: Asynchronies dial up connection Pin
Kuniva15-Jun-03 4:30
Kuniva15-Jun-03 4:30 
QuestionApplication causing Windows clock drift? Pin
Gavin Stark13-Jun-03 18:05
Gavin Stark13-Jun-03 18:05 

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.