Hello,im begginer and i have problem with one of my homework, i have no idea how string and char works, i searching it for around 2 hours but still dont get succesfull output. I will be very glad for any advice on how to do it.
"Develop a program that performs character substitutions. Uppercase characters shall be converted to lowercase,
lowercase characters shall be converted to uppercase and digits shall be replaced by lowercase letters.
The input of your program is a single word, the word is at most 80 characters long."
well that's my problem, i don't know much about technical terms in this links, i check and read it all but its a little hard for me understand how this commands works... all at all i know i must got some string from input and then somehow swap ascii but i have no idea how i should do it in string.
String is a class that contains a sequence of char and provides methods to do all the basic work you might do with a char. So:
String aString = "My String";
aString[index] = tolower(aString[index]));
// aString[index] - the operator  has been overridden in String to treat the string like an array.
// tolower and isupper are defined in the cctype header to deal with the integer equivalent of a character which is required to do the "math".
// note: the operator '=' has also been overridden for dealing with a String.