I am trying to convert string to object in the following piece of code. How can I set the value of any other unrelated invalid input?
object stringToObject(string input){
if (input == "rock")
return object::rock;
else if (input == "paper")
return object::paper;
else if (input == "scisors")
return object::scissors;
}
Aucun commentaire:
Enregistrer un commentaire