imports the printf function : Windows API : Windows C# Source Code


Custom Search

C# Source Code » Windows » Windows API »

 

imports the printf function








    
 

using System;
using System.Runtime.InteropServices;

public class Starter {
    public static void Main() {
        int val1 = 5, val2 = 10;
        API.printf("%d+%d=%d", val1, val2, val1 + val2);
    }
}

public class API {
    [DllImport("msvcrt.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
    public static extern int printf(string formatspecifier, int lhs, int rhs, int total);
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Windows
» Windows API