hello. here is my problem-


say i have variables:

* int a, b, c, d;
string x; *

the string x contains one of four options- a, b, c, d.

now i need a way without using:

* if(x=="a") {..}
if(x=="b") {..}
if(x=="c") {..}
if(x=="d") {..} *

to store a number in one of those variables (a\b\c\d) that are what contained in string x..

for example-
string x="c";
so then i use some kind of *cin>>* function to store some number inside the variable c..

can anyone help me??