Value:tostring( ) method

Converts the C Value to a Lua string

Notes

  • This method is equivalent to the Lua tostring() function that can be called on Value objects too.
  • NULL strings Values are converted to the "NULL" Lua string

Return value

Returns a string representation of the C Value.

Example

local c = require "c" -- Create a Value that contains a C integer value initialized to 125 local c_int = c.int(125) print("C integer value = "..c_int:tostring()) -- Much simpler in this case: -- Ue the concatenate operator, supported for Value objects print("C integer value = "..c_int)