Need help with the backward string part please help me fix this code thank you
// 1. Length of a C-String
int stringlength(char charray[])
{
int length = 0;
// Get the data
// the character string will be passed to function as a parameter
// Determine the length of the C-String
// Use a loop to iterate over the elements and look for '\0'
do {
if ( charray[ length ] == '\0' )
break;
++length;
} while (true);
return length;
}
//2. Backward String
int getthestring( char charray[], int maxsize)
{
int length = 0;
cout << "please enter a single word less than" << maxsize;
cout << "characters in length\n";
cin >> charray;
length = stringlength (charray);
return length;
}
int reversethestring( char charray[], int minsize)
{
int length = 0;
cout << "please enter a single word more than" << minsize;
cout << "characters in length\n";
cin >> charray;
length = stringlength (charray) - 1;
return length;
}
void backwardstring()
{
char charray[256] = {'\0'};
int arrsize = 0;
//2.1 get the data: a function that prompts user for a string
getthestring( charray, 256 - 1);
//2.2 use the data: create a string of backward characters
reversethestring( charray, 256 - 1);
//2.3 output the data: send the backward to the standard output
cout << charray << endl;
}