Printing a static variable inside a C++ function called from lua
snippet in lua

Printing a static variable inside a C++ function called from lua

user7333

static int print_no(lua_State *L)
{
  static double d = lua_tonumber(L, 1); /* get argument */
  lua_pushnumber(L, d);
  return 1; /* number of results */
}