hi im having trouble with a cypher program which asks the user to input a shift number then that number shifts an alphabet array so it is encrypted please help
p.s i cant use headers
#include <iostream>
using namespace std;
int getlength(char[]);
char makecypher(int);
int main(void) {
int shift;
int length = 0;
char inputarray[256];
char array[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't','u', 'v', 'w', 'x','y', 'z' } ;
cout << " Please input a string: ";
cin.getline ( inputarray,256);
for(int i = 0; inputarray[i] != 0; i++)
{
if(inputarray[i] >= 'A' && inputarray[i] <= 'Z')
{
inputarray[i] += 32;
}
length++;
}
for(int j = 0; inputarray[j] != 0; j++)
{
if ((inputarray[j] < 97) || (inputarray[j] > 122))
{
int remove = 1;
for(int k = 0; k < length; k++)
{
inputarray[j+k] = inputarray[j+remove];
remove++;
}
j--;
}
}
cout << "You input: \n" << inputarray <<"\n";
cout << " The length of the string is: " << getlength(inputarray);
cout << "\n";
cout << " please enter the shift value: ";
cin >> shift;
cout << " the alpha : " << makecypher(shift);
cin.ignore(3);
}
int getlength(char inputarray[])
{
int charlength = 0;
while((*inputarray) != '\0')
{
charlength++;
inputarray++;
}
return charlength;
}
char makecypher( int shift )
{
char alphaarray[] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't','u', 'v', 'w', 'x','y', 'z' } ;
char cipherarray[27];
int i = 0;
static int shift;
for (int z = 0; z < 26; z++) {
if (z < 26)
{
cipherarray[z] = alphaarray[shift];
i++; }
}
}
void encrypt ()
{
}