Hello,
I realize that this probably isn't able to be solved with a simple answer. So if you could just point me in the right direction of what I should be learning up on that would be much appreciated. I really am just clueless as to what topic this falls under to read about..
Well, onto my question!
How do I get my program to interpret data from a string and then alter it to then mean something else?
IE:
h = i
e = f
l = m
o = p
INPUT: hello
OUTPUT: ifmmp
Thank you for your time!!Code:int main() { string subject; string message; cout<<"Please enter the SUBJECT: "; getline (cin, subject); cout<<"\n\t\t\t\t*MESSAGE*\n"; getline (cin, message); /* How do I interpret 'message' here and replace letters with a different letter in its place? IE: If the user types "hello" and now I want the program to recognize "h" "e" "l" "l" "o" and replace these with "i" "f " "m" "m" "p" */ ofstream a_msg(subject.c_str()); /* Put "ifmmp" into .txt */ a_msg<<message; a_msg.close(); }



2Likes
LinkBack URL
About LinkBacks



