LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   rand and array (http://www.linuxquestions.org/questions/programming-9/rand-and-array-739001/)

dreamlemon 07-09-2009 05:09 PM

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

raconteur 07-09-2009 07:26 PM

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.


All times are GMT -5. The time now is 09:25 PM.