Z
zl2k
hi, there,
Well, the subject looks fuzzy but here is what I want to do but don't
know how.
Suppose I have
const int John = 123456789;
const int Bill = 111222333;
....
now I have a function
void function(string s){
// s is of "John" or "Bill" or ... and I want to print the number
associated with the name.
// however, I don't want to do if else
}
Thanks a lot.
zl2k
Well, the subject looks fuzzy but here is what I want to do but don't
know how.
Suppose I have
const int John = 123456789;
const int Bill = 111222333;
....
now I have a function
void function(string s){
// s is of "John" or "Bill" or ... and I want to print the number
associated with the name.
// however, I don't want to do if else
}
Thanks a lot.
zl2k