Dear Ehsan

> Aha, now I see.  So you don't want to "shuffle" them, you 
> want to rotate them, right?  This is what I would do:

Rotate is a bit of an odd description, but yes, I suppose that would be
right.

> #include <algorithm>
> 
> void f()
> {
>       int array[ 5 ];
>       // populate it
> 
>       // rotate the first three items
>       std::rotate( array, array + 1, array + 3 ); }
> 
> Pretty straightforward.

It is only straightforward when you understand it!  Just looked it up in the
MSDN it it goes on about First, Middle and Last.

Imagine I have two arrays.  int iNumMonths[5]   and COleDateTime datTime[5]

Now, I have int iNumChanges which states how many of those 5 items are used
in the array

Now, rotate up from item index 1 (for iNumChanges) and put item index 0 at
pos (iNumMonths - 1)

I don't quite understand the above algorithm and what it does....

Do I have to use std::   ?
Can you explain the parameters?

Thanks.


This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.



_______________________________________________
msvc mailing list
[EMAIL PROTECTED]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription 
changes, and list archive.

Reply via email to