Click here to Skip to main content
16,011,120 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Function for random number 'between limits' - how? Pin
Tomasz Sowinski22-Jun-01 9:28
Tomasz Sowinski22-Jun-01 9:28 
GeneralRe: Function for random number 'between limits' - how? Pin
Ben Burnett22-Jun-01 10:04
Ben Burnett22-Jun-01 10:04 
GeneralRe: Function for random number 'between limits' - how? Pin
Tomasz Sowinski22-Jun-01 10:24
Tomasz Sowinski22-Jun-01 10:24 
AnswerRe: Function for random number 'between limits' - how? Pin
22-Jun-01 12:46
suss22-Jun-01 12:46 
GeneralRe: Function for random number 'between limits' - how? Pin
Malcolm McMahon24-Jun-01 22:02
Malcolm McMahon24-Jun-01 22:02 
AnswerRe: Function for random number 'between limits' - how? Pin
Tim Deveaux22-Jun-01 14:09
Tim Deveaux22-Jun-01 14:09 
AnswerRe: Function for random number 'between limits' - how? (Revisited) Pin
Tim Deveaux23-Jun-01 5:05
Tim Deveaux23-Jun-01 5:05 
AnswerRe: Function for random number 'between limits' - how? Pin
Anders Molin23-Jun-01 11:35
professionalAnders Molin23-Jun-01 11:35 
well, I have made this small macro a long time ago:
//get a random number between min and max
#define GetRandom(min, max) ((rand() % (int)(((max) + 1) - (min))) + (min))

You have to call srand() first, if you want to initialize the random generator, something like srand(GetTickCount());

- Anders

Money talks, but all mine ever says is "Goodbye!"
GeneralRe: Function for random number 'between limits' - how? Pin
Tim Deveaux23-Jun-01 13:28
Tim Deveaux23-Jun-01 13:28 
GeneralRe: Function for random number 'between limits' - how? Pin
Anders Molin24-Jun-01 1:40
professionalAnders Molin24-Jun-01 1:40 
AnswerRe: Function for random number 'between limits' - how? Pin
PJ Arends24-Jun-01 11:56
professionalPJ Arends24-Jun-01 11:56 
Generalphilosophy of error handling Pin
Amit Jain22-Jun-01 8:02
Amit Jain22-Jun-01 8:02 
GeneralRe: philosophy of error handling Pin
Tim Deveaux22-Jun-01 14:37
Tim Deveaux22-Jun-01 14:37 
Generalthanks =) Pin
Amit Jain23-Jun-01 19:18
Amit Jain23-Jun-01 19:18 
QuestionHow can i use the UDP on the web ?? Pin
khamis22-Jun-01 7:53
khamis22-Jun-01 7:53 
AnswerRe: How can i use the UDP on the web ?? Pin
markkuk24-Jun-01 20:59
markkuk24-Jun-01 20:59 
GeneralRe: How can i use the UDP on the web ?? Pin
khamis25-Jun-01 2:45
khamis25-Jun-01 2:45 
GeneralWindows NT4 and HP-950c Printer Pin
#realJSOP22-Jun-01 6:21
professional#realJSOP22-Jun-01 6:21 
GeneralComparing Strings. Pin
John Uhlenbrock22-Jun-01 5:51
John Uhlenbrock22-Jun-01 5:51 
GeneralRe: Comparing Strings. Pin
Jim Howard22-Jun-01 6:02
Jim Howard22-Jun-01 6:02 
GeneralRe: Comparing Strings. Pin
John Uhlenbrock22-Jun-01 6:41
John Uhlenbrock22-Jun-01 6:41 
GeneralRe: Comparing Strings. Pin
Jim Howard22-Jun-01 7:08
Jim Howard22-Jun-01 7:08 
GeneralRe: Comparing Strings. Pin
Tomasz Sowinski22-Jun-01 7:18
Tomasz Sowinski22-Jun-01 7:18 
GeneralDooh! Pin
Jim Howard22-Jun-01 8:12
Jim Howard22-Jun-01 8:12 
QuestionHow to handle the ChildFrames ? Pin
Radovan L.22-Jun-01 5:49
Radovan L.22-Jun-01 5:49 

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.