I have the following c++ function and I would like to know how to convert an int to a string for the else clause of the if statement.
string afficherValeurNominal(int val)
{
string valAffiche = "";
if (val == 11) // carte j
{
valAffiche = "V";
}
else if (val == 12) // carte Q
{
valAffiche = "D";
}
else if (val == 13) // carte k
{
valAffiche = "R";
}
else
{
valAffiche = val;
}
return valAffiche;
}
switch (val)instead of repeatedelse if?