Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than msvcrt, prefix the name with the module name and a period.
sprintf (msvcrt)
.
C# Signatures:
// When calling with any variable parameters and Ansi
[DllImport("msvcrt.dll", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.Cdecl)]
static extern int sprintf(
StringBuilder buffer,
string format,
__arglist);
// When calling with any variable parameters and Unicode
[DllImport("msvcrt.dll", CharSet = CharSet.Unicode,
CallingConvention = CallingConvention.Cdecl)]
static extern int swprintf(
StringBuilder buffer,
string format,
__arglist);
// When calling with 1 arg
[DllImport("msvcrt.Dll", CallingConvention=CallingConvention.Cdecl)]
static extern int sprintf([In,Out]StringBuilder buffer, String fmt,
String arg1);
// When calling with 2 args
[DllImport("msvcrt.Dll", CallingConvention=CallingConvention.Cdecl)]
static extern int sprintf([In,Out]StringBuilder buffer, String fmt,
String arg1, String arg2);
// When calling with 3 args
[DllImport("msvcrt.Dll", CallingConvention=CallingConvention.Cdecl)]
static extern int sprintf([In,Out]StringBuilder buffer, String fmt,
String arg1, String arg2, String arg3);
VB Signature:
<DllImport("msvcrt.dll", CharSet:=CharSet.Ansi,
CallingConvention:=CallingConvention.Cdecl,
ExactSpelling:=True)> _
Public Shared Function sprintf(ByVal TargetString As System.Text.StringBuilder,
ByVal FormatSpecifier As String, ByVal i As Int32) As Int32
End Function
swprintf(buffer, "Greetings from thread %d\n", __arglist(Thread.CurrentThread.ManagedThreadId));
Console.WriteLine(buffer.ToString());
Please add some!
Alternative Managed API:
System.String.Format()
Click to read this page
10/2/2011 2:35:57 AM - txzhgh-89.110.151.174
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).