Example #1
0
    // This method is invoked by the WebAssembly code.
    public static void Print(InstanceContext ctx, int ptr, int len)
    {
        Console.WriteLine(".NET Print called");
        var memoryBase = ctx.GetMemory(0).Data;

        unsafe {
            var str = System.Text.Encoding.UTF8.GetString((byte *)memoryBase + ptr, len);

            Console.WriteLine("Received this utf string: [{0}]", str);
        }
    }