I'm getting confused with the changing of the letters. I'm supposed to use 3 functions upper, lower, and reverse. The upper should accept a c-string as an argument and go through all the characters in the string, converting each to uppercase. the lower should accept a pointer to a c-string as an argument and go through all the characters in the string converting each to lover case. The reverse should also accept a c-string and test each character to determine whether it is upper or lower and change it
I think "Invert" would be less confusing that "Reverse" but that's just me. When you read into a cstring allocated as string[80] you can only read in 79 characters because there needs to be a place for the null terminator. If you never enter more than 79 everything is peachy but if you did then you'd go outside the bounds of the array.
1 2
constint SIZE = 80;
char str[SIZE+1]; // this can fit 80 characters *and* the null terminator
Also tolower() and touppper() return values so you'd need to assign them
Write a program with three functions: upper,lower,and reverse. The upper function should accept a c-string as an argument. It should step through all the characters in the string, converting each to uppercase. The lower function, too, should accept a pointer to a c-string as an argument. It should step through all the characters in the string, converting each to lowercase. Like upper and lower, reverse should also accept 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. If a character is lowercase, it should be converted to uppercase. Test the functions by asking for a string in function main, then passing it to them in the following order: reverse, lower, and upper
How is it not a question, i'm supposed to write a program that does 3 functions. My question is how do i fix the program to change the text from upper case to lower case and from lower case to upper case. And I also need to do a reverse function
okay, i was doing some work to it and i think i got the upper and lower to work. I just can't figure out the reverse. how would i go about working on it