-1

in my project I need to convert Deciml variable to char*; Coz I need to save the value that user entered in a numericupdown control in a xml output using tinyXML. the function that I am using for printing text in tinyXMl, take the char* parameter.

TiXmlText(char *);

Golnaz Saraji
  • 154
  • 1
  • 3
  • 14

1 Answers1

0

What do you mean by Decimal? Perhaps int? See itoa() in the C runtime, or

template<typename T>
std::string to_string(T num)
{
    std::ostringstream stream;
    stream << num;
    return stream.str();
}

and call

TiXmlText(to_string(666).c_str());
cdmh
  • 3,294
  • 2
  • 26
  • 41
  • Hi friend! thank you so much for your help; I think that the value type in numericupdown is Decimal; so I need to do so :); let me to check your way in my project :) – Golnaz Saraji Jul 31 '13 at 06:34