Hi,
I am developing a program in c++ and what i want to do is to assign an integer to a character. To become more specific i want to make an alphabet and assign to each letter a number. So far so good. The problem is that i want it with user input. For instance see the code below:
int main () {
const unsigned int a=1, b=2, c=3, d=4, e=5, f=6, g=7; //and so on..
int input;
cout << "Please enter a word: " <<endl;
cin >> input;
cout << "The output is: " << ...
<< moderator edit: added [code][/code] tags, reduced indent >>
For example if the user decides to type the word 'bad' i want the output to be displayed in numbers: in our example that would be: 2 1 4 which stands for b a d...
I know it sound easy but i am kinda new to c++ and i dont know even what to look for in the net to concerning this issue, so any help would be greatly appreciated.
--Thanx in advance--