title: Lua function return string with C++
body: <p>Is it possible to add a function to Lua via C++ that returns a string?
  -edit-
  Ok, this code wont work. Any help?</p>
  
  <pre><code>int flua_getinput(lua_State *L){
      if(lua_isstring(L,1)){
          cout &lt;&lt; lua_tostring(L,1);
          cin &gt;&gt; input;
          cout &lt;&lt; "\n";
          lua_pushstring(L,input);
      }else{
          cin &gt;&gt; input;
          cout &lt;&lt; "\n";
          lua_pushstring(L,input);
      }
      return 1;
  }
  Registering Function:
  
  lua_register(L,"getinput",flua_getinput);
  </code></pre>