sea*_*ley 19
如果你想要一个真正的lua表:
lua_newtable(L);
int top = lua_gettop(L);
for (std::map::iterator it = mymap.begin(); it != mymap.end(); ++it) {
const char* key = it->first.c_str();
const char* value = it->second.c_str();
lua_pushlstring(L, key, it->first.size());
lua_pushlstring(L, value, it->second.size());
lua_settable(L, top);
}
Run Code Online (Sandbox Code Playgroud)
使用正确的地图类型替换为..
归档时间: |
|
查看次数: |
10715 次 |
最近记录: |