void () { CLib cLib = Native.load("c", CLib.class); try (Memory memory = new Memory(16)) { int len = cLib.sprintf(memory, "%d plus %d is %d", 3, 5, 8); assertEquals(13, len); assertEquals("3 plus 5 is 8", memory.getString(0)); } }