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
rand() function with a linked list
rand() function with a linked list
Aug 15, 2011 at 7:03pm UTC
b10c
(1)
Hey im trying to generate a linked list with random items/keys, only when i get my list, all the items are the same random number, and all the keys are all similar too. what am i doing wrong here....?
Aug 15, 2011 at 7:23pm UTC
hamsterman
(4538)
linked lists don't have keys..
what am i doing wrong here....?
what are you doing at all? my guess is that you're calling srand before each rand (you should only call it once), though it could be anything..
Topic archived. No new replies allowed.