Click here to Skip to main content
16,012,611 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: strtok - reconstruct string after it finds a token Pin
jimNLX27-Dec-02 10:42
jimNLX27-Dec-02 10:42 
GeneralRe: strtok - reconstruct string after it finds a token Pin
Renjith Ramachandran27-Dec-02 13:27
Renjith Ramachandran27-Dec-02 13:27 
QuestionWhere is random() in Visual C++.net ? Pin
HellShrimp4free27-Dec-02 9:52
HellShrimp4free27-Dec-02 9:52 
AnswerRe: Where is random() in Visual C++.net ? Pin
Nish Nishant27-Dec-02 10:00
sitebuilderNish Nishant27-Dec-02 10:00 
GeneralRe: Where is random() in Visual C++.net ? Pin
HellShrimp4free27-Dec-02 10:11
HellShrimp4free27-Dec-02 10:11 
GeneralRe: Where is random() in Visual C++.net ? Pin
S O S27-Dec-02 10:28
S O S27-Dec-02 10:28 
GeneralRe: Where is random() in Visual C++.net ? Pin
Nick Parker27-Dec-02 11:04
protectorNick Parker27-Dec-02 11:04 
AnswerRe: Where is random() in Visual C++.net ? Pin
UrbanBlues27-Dec-02 22:11
UrbanBlues27-Dec-02 22:11 
Hi

Those two functions have always been there. In fact I never used (saw ?) the function Random()

Here is how to use them:

// Seed Random-number Generator with Current Time
srand(( unsigned) time(NULL ));

int nRandomData = rand() % 4;

Replace 4 with the Maximum value accepted (1000 in your request)

The call to srand with current time allows the generation of different random sequences. If you start always with the same number, you always got the same sequence ( as far as I remember) ...

HTH

Thierry



GeneralOptimizing a pooling mechanism... Pin
Matt Gullett27-Dec-02 9:29
Matt Gullett27-Dec-02 9:29 
GeneralCSliderCtrl and textout Pin
ns27-Dec-02 9:01
ns27-Dec-02 9:01 
GeneralRe: CSliderCtrl and textout Pin
PJ Arends27-Dec-02 9:41
professionalPJ Arends27-Dec-02 9:41 
GeneralRe: CSliderCtrl and textout Pin
ns27-Dec-02 9:45
ns27-Dec-02 9:45 
GeneralMDI: Single Doc, Multiple Views Pin
Dean Goodman27-Dec-02 9:00
Dean Goodman27-Dec-02 9:00 
GeneralRe: MDI: Single Doc, Multiple Views Pin
Chris Losinger27-Dec-02 10:25
professionalChris Losinger27-Dec-02 10:25 
GeneralCIPAddressCtrl example Pin
ns27-Dec-02 8:18
ns27-Dec-02 8:18 
GeneralActivating a window and bringing it to the top Pin
Navin27-Dec-02 7:23
Navin27-Dec-02 7:23 
GeneralRe: Activating a window and bringing it to the top Pin
Navin27-Dec-02 7:28
Navin27-Dec-02 7:28 
GeneralRe: Activating a window and bringing it to the top Pin
Nish Nishant27-Dec-02 7:28
sitebuilderNish Nishant27-Dec-02 7:28 
GeneralRegarding terminology Pin
Nish Nishant27-Dec-02 6:27
sitebuilderNish Nishant27-Dec-02 6:27 
GeneralRe: Regarding terminology Pin
AlexO27-Dec-02 6:47
AlexO27-Dec-02 6:47 
GeneralRe: Regarding terminology Pin
Nish Nishant27-Dec-02 6:55
sitebuilderNish Nishant27-Dec-02 6:55 
GeneralRe: Regarding terminology Pin
Michael Dunn27-Dec-02 6:59
sitebuilderMichael Dunn27-Dec-02 6:59 
GeneralRe: Regarding terminology Pin
Nish Nishant27-Dec-02 7:23
sitebuilderNish Nishant27-Dec-02 7:23 
GeneralPROGRAM ICONS (portability and configurability) Pin
Anonymous27-Dec-02 6:01
Anonymous27-Dec-02 6:01 
Generalmessage map question Pin
ns27-Dec-02 5:22
ns27-Dec-02 5:22 

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.