How am I able to convert Standard_Real to Standard_CString?
I know it is a very stupid question. Please help if you know how!!
Thanks
Rob Bachrach Thu, 07/29/2004 - 14:42
It's not a stupid question, but an easy one to answer.
Remember, Standard_CString is a typedef to a char* and
Standard_Real is a typedef to a double. The easiest way
to convert is to create a character array and use sprintf.
You can also use strstream (or Standard_SStream) and use
stream operators and manipulators, but this is probably
more overhead than is necessary.
Thu, 07/29/2004 - 14:42
It's not a stupid question, but an easy one to answer.
Remember, Standard_CString is a typedef to a char* and
Standard_Real is a typedef to a double. The easiest way
to convert is to create a character array and use sprintf.
You can also use strstream (or Standard_SStream) and use
stream operators and manipulators, but this is probably
more overhead than is necessary.
Wed, 11/09/2005 - 12:19
for future reference:
TCollection_AsciiString has a constructor which requires a Standard_Real value