This is the code snippet:
...
int nTest = 10;
String * pMsg = String::Format( "Display an integer here: {0}", nTest);
...
I got the following error message when tried to compile the program:
error C2665: 'System::String::Format' : none of the 5 overloads can convert
parameter 2 from type 'int'
Am I missing anything here?
Willy Denoyette [MVP] - 11 Jul 2005 20:00 GMT
> This is the code snippet:
> ...
[quoted text clipped - 8 lines]
>
> Am I missing anything here?
Please consult the docs before posting, in this case the 2nd argument must
be an object, so you have to box the int.
...., __box(nTest));
Willy.