[LC++]Seperate an array into smallest to highest elements

Ezra Taylor ezratay1 at netzero.net
Tue Feb 19 13:04:02 UTC 2002


I want  to display  a[i] ....... a[middle] on one line then a[middle +1] 
...... a[i-1] on the next.


In other words, a[i] to the middle of the array then the next element 
from the middle to the last element displayed on a seperate line.

Thanks
Ezra Taylor

Mark Phillips wrote:

>Ezra Taylor wrote:
>
>>Hello all:
>>                     I'm new to C++, if this question is to infantile for
>>this list; lash me with kindness.
>>
>>Now, I want to take an array with x elements and separate(print) them
>>into smallest to highest elements.  The array is already sorted.  Please
>>use novice C++ explanations.
>>
>
>If I understand correctly what you want to do, it would be something
>like this:
>
>int const x=100;
>int myArray[x];
>
>for (int i=0; i<x; ++i)
>  cout<<"myArray["<<i<<"] = "<<myArray[i]<<endl;
>
>Is that what you wanted to do?
>
>Cheers,
>
>Mark.
>_______________________________________________
>This is the Linux C++ Programming List
>: http://lists.linux.org.au/listinfo/tuxcpprogramming List
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20020219/ae2c73f1/attachment.htm 


More information about the tuxCPProgramming mailing list