You call lua_pcall with the number of arguments you are passing and the number of results you want. The fourth argument indicates an error-handling function; we will discuss it in a moment. As in a Lua assignment, lua_pcall adjusts the actual number
这阵子在学习lua,今天看到string操作,书中描述string.gsub(sourceString, pattern, replacementString)返回一个字符串,但是我在实际操作中却发现,这个函数其实返回的是两部分内容,一部分是替换后的字符串,一部分是替换长度. myString = "my name is lucy, my phone numbre is 010-88993366." print(string.gsub(myString, "%d",
当 Lua 调用 C 函数的时候,使用和 C 调用 Lua 同样类型的栈来交互. C 函数从栈中获取她的參数.调用结束后将返回结果放到栈中.为了区分返回结果和栈中的其它的值,每一个 C 函数还会返回结果的个数(the function returns (in C) the number of results it is leaving on the stack.). // luacallcpp.cpp : 定义控制台应用程序的入口点. // #include "stdafx.