How to call unmanaged functions that are implemented in a DLL file with C#

1 Answer

0 votes
using System.Runtime.InteropServices;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        [DllImport("msvcrt.dll")]
        public static extern int puts(string c);

        static void Main(string[] args)
        {
            puts("c# programming");
        }
    }
}


/*
run:

c# programming

*/

 



answered Apr 27, 2017 by avibootz

Related questions

...