Click here to Skip to main content
16,005,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: random numbers within given range Pin
Nishad S18-Apr-06 1:09
Nishad S18-Apr-06 1:09 
AnswerRe: random numbers within given range Pin
toxcct18-Apr-06 1:10
toxcct18-Apr-06 1:10 
AnswerRe: random numbers within given range Pin
Cedric Moonen18-Apr-06 1:14
Cedric Moonen18-Apr-06 1:14 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 1:25
9ine18-Apr-06 1:25 
GeneralRe: random numbers within given range Pin
Cedric Moonen18-Apr-06 1:29
Cedric Moonen18-Apr-06 1:29 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 2:00
9ine18-Apr-06 2:00 
GeneralRe: random numbers within given range Pin
Russell'18-Apr-06 1:40
Russell'18-Apr-06 1:40 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 1:55
9ine18-Apr-06 1:55 
I wanted to know if say in the case of MAXVAL=4 rand()%MAXVAL will result in spliting our 0...MAXRAND into:

rand range 0...15:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

rand()%MAXVAL range:
0,1,2,3,0,1,2,3,0,1,2,3,0,1,2,3

this looks as we splitted our 0..MAXRAND range to adjasent quartets of 0,1,2,3 any number from 0..MAXRAND will fal into this range



but if the division of 0...15
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15

to the sequence:
0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3


in first case rand val 6 will result in value of 2
in second 6 will result in 1



9ine
GeneralRe: random numbers within given range Pin
Russell'18-Apr-06 2:18
Russell'18-Apr-06 2:18 
GeneralRe: random numbers within given range Pin
9ine18-Apr-06 2:52
9ine18-Apr-06 2:52 
Questionhow can i retrieve RegNotifychangekey values Pin
keerthikaaa18-Apr-06 0:35
keerthikaaa18-Apr-06 0:35 
AnswerRe: how can i retrieve RegNotifychangekey values Pin
David Crow18-Apr-06 2:38
David Crow18-Apr-06 2:38 
AnswerRe: how can i retrieve RegNotifychangekey values Pin
Hamid_RT18-Apr-06 19:01
Hamid_RT18-Apr-06 19:01 
QuestionCheck Privileges in MFC Pin
QuickDeveloper18-Apr-06 0:34
QuickDeveloper18-Apr-06 0:34 
AnswerRe: Check Privileges in MFC Pin
David Crow18-Apr-06 2:40
David Crow18-Apr-06 2:40 
Questionwhere to store array of 2 different datatypes Pin
lorey17-Apr-06 23:59
lorey17-Apr-06 23:59 
AnswerRe: where to store array of 2 different datatypes Pin
Cedric Moonen18-Apr-06 0:02
Cedric Moonen18-Apr-06 0:02 
GeneralRe: where to store array of 2 different datatypes Pin
lorey18-Apr-06 0:06
lorey18-Apr-06 0:06 
GeneralRe: where to store array of 2 different datatypes Pin
Cedric Moonen18-Apr-06 0:11
Cedric Moonen18-Apr-06 0:11 
GeneralRe: where to store array of 2 different datatypes Pin
lorey18-Apr-06 0:18
lorey18-Apr-06 0:18 
GeneralRe: where to store array of 2 different datatypes Pin
Rob Caldecott18-Apr-06 2:57
Rob Caldecott18-Apr-06 2:57 
AnswerRe: where to store array of 2 different datatypes Pin
Nemanja Trifunovic18-Apr-06 2:31
Nemanja Trifunovic18-Apr-06 2:31 
QuestionOrder of views in MDI application Pin
Le Thanh Cong17-Apr-06 23:36
Le Thanh Cong17-Apr-06 23:36 
AnswerRe: Order of views in MDI application Pin
Parthiban18-Apr-06 0:36
Parthiban18-Apr-06 0:36 
GeneralRe: Order of views in MDI application Pin
Le Thanh Cong18-Apr-06 20:10
Le Thanh Cong18-Apr-06 20:10 

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.