Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-09-2009, 05:09 PM   #1
Registered: Feb 2007
Distribution: Slackware
Posts: 37

Rep: Reputation: 15
rand and array

Hello programmers,
Can you teach me how to
select one element from an array via random order
then finally all the elements of that array are used(selected) once.
For example,there is an array
{ 2,4,6,8 }
I may need the following selection.
2,6,8,4 or
4,8,6,2 and so on.
How to do this in C?
I also use TCL.
If you can program this in TCL
I will be grateful to this
Old 07-09-2009, 07:26 PM   #2
Registered: Dec 2007
Location: Slightly left of center
Distribution: slackware
Posts: 276
Blog Entries: 2

Rep: Reputation: 44
Please forgive the assumption, but is this a homework assignment?
Most folks here would ask that you at least give it a try, and post what you've tried (enclosed in code tags, please).
Even if it isn't homework, I think you'll find folks far more willing to help if you show an attempt at it ... that helps us gauge what level of help you might need.
Most of us here can show you some simple and elegant methods for accomplishing the task in C, I'm not all that great with TCL but I get by, other folks here are certainly better.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rand() function in linux ko589 Programming 6 04-28-2009 09:48 AM
using rand in matlab lmvent Programming 10 02-23-2009 05:35 PM
LXer: Mono and RAND LXer Syndicated Linux News 0 05-28-2008 12:20 PM
rand() question deiussum Programming 6 11-11-2004 03:10 PM
Need help using rand() in C KneeLess Programming 12 10-01-2003 01:51 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration