SweetScape Knowledgebase
KB1016: How do I convert an int to a string?

The easiest way to convert an integer (short, int, int64, etc.) to a string is to use the SPrintf function. For example:

     ushort a = 16;
     string s;
     SPrintf( s, "%d", (int)a );

After this code is executed, the variable 's' will contain the string '16'. Remember when using the SPrintf function that the arguments passed to the function must match the format string (e.g. when using '%d' you must pass an int, not a short).



Back to knowledgebase index
Back to main support page




Our Products


Latest News
Download
- 010 Editor
v3.1.2
is now available.
Download it now!
What's New in 3.1.2?


Newsletter
Join our newsletter to receive tips and tricks on hex editing, special offers, and news from SweetScape Software.

Sign-up Now...





SweetScape Software
148 Pownal Rd. RR#1
Pownal, PEI
C0A 1Z0, Canada

E-mail: