lua_pushfstring
const char *lua_pushfstring (lua_State *L, const char *fmt, ...);
Pushes onto the stack a formatted string
and returns a pointer to this string.
It is similar to the C function sprintf
,
but has some important differences:
%%
' (inserts a '%
' in the string),
'%s
' (inserts a zero-terminated string, with no size restrictions),
'%f
' (inserts a lua_Number
),
'%p
' (inserts a pointer as a hexadecimal numeral),
'%d
' (inserts an int
), and
'%c
' (inserts an int
as a character).