|
-
July 13th, 2006, 04:19 AM
#1
Urgent Variable Question
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??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|