I am struggling with this assignment to long i need someone to tell me what am i doing wrong
Write a program with three functions: upper, lower, and reverse.
The upper function should accept a pointer to a c-string as an argument. It should step through each character in the string, converting it to uppercase.
The lower function, to should accept a pointer to a c-string as an argument. It should step through each character in the string converting it to lower case.
Like upper and lower, reverse should also accept a pointer to a c-string. As it steps through the string, it should test each character to determine whether it is upper or lowercase. If a character is uppercase, it should be converted to lowercase. Likewise, if a character is upper case it should be converted to lowercase. Likewise, if a character is lowercase is should be converted to uppercase.
#include <iostream>
#include <cstring>
#include <cctype>
using namespace std;
char* reverse (char*, int);
char* lower (char*, int);
char* upper (char*, int);
int main ()
{
const int SIZE = 80;
char myString [SIZE];
int strLength;
//Prompt user for string
cout << "Please enter a string.\n";
//read in string
cin.getline(myString, SIZE);
//find and display length
strLength = strlen(myString);
cout << "Your string is " << strLength << " characters long\n";
//call reverse function and output results in main to screen
reverse(myString, strLength);
cout << "Your string reversed: ";
for (int count = 0; count < strLength; count++)
cout << reverse(myString, strLength);
cout << myString[count] = tolower;
cout << endl;
//call lower function and output results in main to screen
lower(myString, strLength);
cout << "Your string in lowercase: ";
for (int count = 0; count < strLength; count++);
cout << myString[count] ;
cout << endl;
//call upper function and output results in main to screen
upper(myString, strLength);
cout << "Your string in uppercase: ";
for (int count = 0; count < strLength; count++)
cout << myString[count];
cout << endl;
return 0;
// function that reverses the case of string
char* reverse (char * string, int SIZE)
for(int count = 0; count < SIZE; count++)
{
if (isupper(string[count]))
tolower(string[count]);
else if (islower(string[count]))
toupper(string[count]);
}
return string;
// function that puts entire string in lower case
char* lower (char * string, int SIZE)
{
for(int count = 0; count < SIZE; count++)
tolower(string[count]);
return string;
}
// function that puts entire string in upper case
char* upper (char * string, int SIZE)
{
for(int count = 0; count < SIZE; count++)
toupper(string[count]);
return string;
}
}