Ok, maybe this is a very stupid question but wich is the cleanest way to convert an int to a System::String with always at least 2 chars...
Now, I do this:
String* convertTo2CharString(int num){
if(num<10)
return String::Concat(S"0", Convert::ToString(int));
else
return Convert::ToString(int);
}
I suppose that with the String::Format, I can do it with one line of code but I don't know how. Tnx.

how to format a two or one digits number in a two char string?
jhobitz
couldn't find solution yet.
mattpdk
http://msdn.microsoft.com/visualc/whidbey/
neetu_fzr
using namespace System;
int main()
{
int i = 5;
Console::WriteLine(i.ToString()->Format("02"));
}
s_karthik_au
But I feel dumb now... A new syntax Is this related to .net 2.0 platform and Whidbey Maybe I'm doing code that is already deprecated... :( Info, info, info, please.... a link would be great, start searching... Ok, after this I'll stop to stress you...
Deepak Juneja
Rick Bunnell
I didn't know that I could dereference integers... I'm a little bit confused now; so an int in Managed C++ is derived from Object and it's allocated in the managed stack (and is a managed type)
But, it doesn't compile... :(
error C2661: 'System::String::Format' : no overloaded function takes 1 arguments
I'm now looking in MSDN library to find answer...
pinkpanter
I aplogize: I missed the fact that you weren't using the new syntax. Try this variation:
#using <mscorlib.dll>
using namespace System;
int main()
{
int i = 5;
Console::WriteLine(i.ToString("d2"));
}