Click here to Skip to main content
16,007,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: random number Pin
Antony M Kancidrowski30-Mar-04 23:49
Antony M Kancidrowski30-Mar-04 23:49 
GeneralRe: random number Pin
SJolly30-Mar-04 23:50
SJolly30-Mar-04 23:50 
GeneralRe: random number Pin
Tim Smith31-Mar-04 3:53
Tim Smith31-Mar-04 3:53 
GeneralRe: random number Pin
SJolly31-Mar-04 4:53
SJolly31-Mar-04 4:53 
GeneralRe: random number Pin
David Crow31-Mar-04 2:21
David Crow31-Mar-04 2:21 
GeneralRe: random number Pin
Paul Ranson31-Mar-04 2:20
Paul Ranson31-Mar-04 2:20 
GeneralRe: random number Pin
Tim Smith31-Mar-04 3:57
Tim Smith31-Mar-04 3:57 
GeneralRe: random number Pin
Paul Ranson31-Mar-04 4:20
Paul Ranson31-Mar-04 4:20 
I only had to write one line.... But it was necessary to cut and paste a bit to make it make sense here.

Anyway it's the ease of using the random_shuffle that's important. The OP didn't want a sequence of random numbers, AFAICT.

It could of course be written,

<br />
void Random1000()<br />
{<br />
int vi [ 1000 ] ;<br />
for ( int i = 0; i < 1000; ++i )<br />
vi [ i ] = i ;<br />
std::random_shuffle ( vi, vi + 1000 ) ;<br />
...<br />
}<br />


Paul
Generalmpeg streamer Pin
Florin Ochiana30-Mar-04 22:10
Florin Ochiana30-Mar-04 22:10 
GeneralDirectInput Gamepad axes name localization.... Pin
haust30-Mar-04 21:59
haust30-Mar-04 21:59 
Generalabout socket Pin
Member 98096830-Mar-04 21:32
Member 98096830-Mar-04 21:32 
GeneralRe: about socket Pin
Antony M Kancidrowski31-Mar-04 0:24
Antony M Kancidrowski31-Mar-04 0:24 
GeneralForm view problem Pin
Raghunandan S30-Mar-04 21:19
Raghunandan S30-Mar-04 21:19 
GeneralRe: Form view problem Pin
Antti Keskinen30-Mar-04 21:34
Antti Keskinen30-Mar-04 21:34 
QuestionHow to replicate a directory? Pin
RickardIsraelsson30-Mar-04 21:07
RickardIsraelsson30-Mar-04 21:07 
AnswerRe: How to replicate a directory? Pin
David Crow31-Mar-04 2:25
David Crow31-Mar-04 2:25 
GeneralCTreeView Pin
fbachan30-Mar-04 21:03
fbachan30-Mar-04 21:03 
GeneralRe: CTreeView Pin
ohadp30-Mar-04 21:36
ohadp30-Mar-04 21:36 
GeneralCopy of Array of Bytes Pin
JeabJB30-Mar-04 21:03
JeabJB30-Mar-04 21:03 
GeneralRe: Copy of Array of Bytes Pin
ohadp30-Mar-04 21:34
ohadp30-Mar-04 21:34 
GeneralRe: Copy of Array of Bytes Pin
JeabJB30-Mar-04 23:04
JeabJB30-Mar-04 23:04 
GeneralRe: Copy of Array of Bytes Pin
David Crow31-Mar-04 2:31
David Crow31-Mar-04 2:31 
QuestionWhat is &quot;Visual Studio (MSI)&quot;? Pin
Vasiliy Baranov30-Mar-04 20:50
Vasiliy Baranov30-Mar-04 20:50 
AnswerRe: What is &quot;Visual Studio (MSI)&quot;? Pin
Colin Angus Mackay30-Mar-04 21:45
Colin Angus Mackay30-Mar-04 21:45 
GeneralRe: What is &quot;Visual Studio (MSI)&quot;? Pin
Vasiliy Baranov30-Mar-04 22:00
Vasiliy Baranov30-Mar-04 22:00 

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.