Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


#Actualrip-off

Posted 15 February 2013 - 06:10 AM

Helper functions will simplify even further:

 

void setNumber(TextWidget &widget, int number) {
    // As BitMaster says, this int/string conversion logic could be moved elsewhere
    std::stringstream stream;
    stream << number;
    widget.setText(stream.str());
}
 
// Later
setNumber(my_test, unit.attack_power);

#1rip-off

Posted 15 February 2013 - 06:09 AM

Helper functions will simplify even further:

void setNumber(TextWidget &widget, int number) {
    std::stringstream stream;
    stream << number;
    widget.setText(stream.str());
}
 
// Later
setNumber(my_test, unit.attack_power);

PARTNERS