Hello
I am to write a program that will drop a certain character from a string.
Such as with the string "hi hun" I want the h to be dropped thus "i un". I'd also like to do it for uppercase letters as well. Here is my attempt thus far, only focusing on getting one case to drop rather than an uppercase as well.
The output I recieve is in all h'Code:#include <iostream.h> char remove(char[]); int main() { const int MAX = 80; char message[MAX]; cout << "Enter a message: " << endl; cin.getline(message, MAX); remove(message); cout << message << endl; return 0; } char remove(char mes[]) { for(int i = 0; mes[i] != '\0'; i++) if (mes[i] = 'h') (mes[i] - 'h' + ' '); }
Thanks