-
Random Integers?
Who do you get CPP to give you one?
Doesn't it have something to do with time.h?
-
Re: Random Integers?
"Hickaru" <hickaru@netzero.net> wrote:
>
>Who do you get CPP to give you one?
>Doesn't it have something to do with time.h?
Use the rand() function. Contained in stdlib.h
Quite often u also include time.h as the random number generator has to be
seeded and an easy way to do this is with the time, eg
srand( (unsigned)time( NULL ) );
hope that helps,
Matt
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|