cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
i have big problem rand()
Page 2
i have big problem rand()
Pages:
1
2
Sep 21, 2010 at 1:35am UTC
Athar
(4466)
Looks like your compiler is a major annoyance. I'd just disable that particular warning (if possible), but instead you can explicitly cast to the desired type:
srand((
unsigned
int
)time(0));
Edit: too slow.
Last edited on
Sep 21, 2010 at 1:36am UTC
Sep 21, 2010 at 1:46am UTC
jsmith
(5804)
srand( time( 0U ) );
does the trick without the cast.
Sep 21, 2010 at 1:55am UTC
Zhuge
(4664)
Really? I thought the problem was because time() returns a time_t and not an unsigned int?
Topic archived. No new replies allowed.
Pages:
1
2