# shifting an array in C



## Business_Woman (May 25, 2010)

Hi,

Im trying to figure out a way to shift an array on integers x number of steps.

for example, shifting the array,

```
array[] = { 0,1,2,3,4,5,6,7,8,9 }
```
one step would result in:

```
array[] = { 9,0,1,2,3,4,5,6,7,8 }
```

Any ideas?


----------



## expl (May 25, 2010)

http://pastebin.com/QGp34DSk


----------



## mickey (May 26, 2010)

Yet another approach... shifts left/right
http://pastebin.com/CzdzR4fU


----------



## Business_Woman (May 26, 2010)

Nice, looked a bit tricky though =(


----------

