Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: string.SetText()  (Read 1921 times)

0 Members and 1 Guest are viewing this topic.

rockstar8577

  • Newbie
  • *
  • Posts: 12
    • View Profile
string.SetText()
« on: January 24, 2010, 07:09:41 pm »
Is there a way to set the text of a string to a float, or an integer?

*Edit*
Thanks Laurent, i saw what you posted on another topic that had the same question. :)

Incase anyone needs the same answer

//Modified for SFML
#include <sstream>

var variable_name = x;
std::stringstream out;
out << variable_name;
sting_name.SetText(out.str());

//Original Way
#include <sstream>

int i = 5;
std::string s;
std::stringstream out;
out << i;
s = out.str();

 

anything