Converting int to Hex String
-
Anyone know how I would do this? I would think it's something like...
int myNum = 7424; String * myNumAsHex = Convert::ToString(myNum, "X");
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas? -
Anyone know how I would do this? I would think it's something like...
int myNum = 7424; String * myNumAsHex = Convert::ToString(myNum, "X");
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas? -
Anyone know how I would do this? I would think it's something like...
int myNum = 7424; String * myNumAsHex = Convert::ToString(myNum, "X");
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas? -
Anyone know how I would do this? I would think it's something like...
int myNum = 7424; String * myNumAsHex = Convert::ToString(myNum, "X");
That doesn't work of course because I think you need to use the IFormatProvider class but I can't seem to use it correctly, any ideas? -
Thanks for your suggestions, is there a way to use the .NET framework to do this? Or must I use native code?
-
are you sure, you CANT do it , the way you mentioned?? I did something like byte b = 44; string str = b.TosTring("X"); and it worked....
-
I figured it out, you need to use the Int32 class, AFAIK byte is a value type in MC++ so it couln't have the ToString associated with it. So it's
Int32 test = 5432; String * testStr = test.ToString("X");
What? Value types derive from System.ValueType which in turn derives from System.Object, so they do have ToString() defined. Regards Senthil