I have this assignment that requires a program that will initialize an array of charcters to ABCDE and allow you to shift in a circular fashion, those characters to the right any number of places you specify.The shifting shoud be done in the functino shift()
but all printouts should be from main the program does not repeat. I have started but I have no idea where to go from there.Any ideas?
#include<iostream>
using namespace std;
//function prototype
void shift(char,int);
int main()
{
//declare variables
int places=0;
int count=0;
//declare array
char chrs[5]={'A','B','C','D','E'};
char temp[5]={' ',' ',' ',' ',' '};
//Display
shift(chrs,places)
cout<<"Before shifting:"<<chrs[5]<<endl;
cout<<"Shift how many places?";
cin>>places;
if(places!=0)
{
cout<<"After shifting"<<endl;
else
cout<<"After shifting"<<chrs[5],,endl;
return 0;
}//end of main function
//*****program-defined functions*****
void shift(char chrs[5],int places)