c++ 11 shift right vector code example
Example: shift array elements to left c++
int temp=arr[0];
/******************************** Method 1
for (int i = 0; i < SIZE - 1; i++)
{
arr[i] = arr[i + 1];
}
arr[SIZE-1]=temp;
*/
// Method 2
for (int i = 1; i < SIZE - 1; i++)
{
arr[i - 1] = arr[i];
}
arr[SIZE - 1] = temp;
for (int i = 0; i < SIZE; i++)
cout << arr[i] << "\t";
cout << endl;