By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,159 Members | 888 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,159 IT Pros & Developers. It's quick & easy.

Random Numbers and Removing only 1 item at a time

P: n/a
I have a double-linked list. I need to insert RANDOM numbers into it. The
rand() function doesn't put "random" number in the list, in the sense that
every time you run the program it should produce new numbers. Also, I need
to know if it is possible to remove just one of an item, instead of all that
match the given criteria with the remove command. Any thoughts?
Dec 8 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
deanfamily <de********@verizon.net> wrote:
I have a double-linked list. I need to insert RANDOM numbers into it. The
rand() function doesn't put "random" number in the list, in the sense that
every time you run the program it should produce new numbers.


Are you seeding the random number generator? Look up srand().

--
Marcus Kwok
Dec 8 '05 #2

P: n/a
"Marcus Kwok" <ri******@gehennom.net> wrote in message
news:dn**********@news-int.gatech.edu...
deanfamily <de********@verizon.net> wrote:
I have a double-linked list. I need to insert RANDOM numbers into it.
The
rand() function doesn't put "random" number in the list, in the sense
that
every time you run the program it should produce new numbers.


Are you seeding the random number generator? Look up srand().

--
Marcus Kwok


I didn't know of that until you mentioned it, but I just implemented it in
my code, and it works just fine. Thanks for the idea.
Dec 8 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.