while megatrons answer is correct, it is somewhat possible to switch on a string using a hack. in this case it is hashing the string. unfortunately i cant find my example. you can also use std::map. shamieh: please refrain from posting like that. its pointless