Raised This Month: $ Target: $400
 0% 

Rotating an Array?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 09-13-2016 , 12:38   Rotating an Array?
Reply With Quote #1

Is there a better way to do this?

Code:
int arrayNums[] = { 1, 2, 3};
int first = arrayNums[0];

for (int i = 0; i < 2; i++)
{
  arrayNums[i] = arrayNums[i+1]
}

arrayNums[2] = first
__________________

Last edited by Marcus101RR; 09-13-2016 at 12:42.
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
 



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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:11.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode