scanf (msvcrt)
Last changed: anonymous

.
Summary
Read formatted data from standard input

C# Signature:

[DllImport("msvcrt.dll", SetLastError=true)]
static extern int scanf(string format, __arglist);

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

Use System.Text.StringBuilder instead of System.String.

Tips & Tricks:

Please add some!

Sample Code:

        [DllImport("msvcrt.dll")]
        public static extern int scanf(string format, __arglist);

        public static void Main(string[] args)
        {
            int i;
            float f;
            StringBuilder s = new StringBuilder();
            int count = scanf("%d-%f-%s", __arglist(out i, out f, s));
            Console.WriteLine("Read {0} values: {1}, {2}, {3}", count, i, f, s);
        }

Documentation
scanf on MSDN