[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Working with table from C++
- From: David Haley <dchaley@...>
- Date: Tue, 08 Apr 2008 21:22:05 -0700
On this day of 04/08/2008 06:31 PM, Eugen-Andrei Gavriloaie saw fit to
> It might sound stupid, but it seems that I can't find a way to iterate
> through a table in c++. Suppose we have a table pushed onto the stack
> (lua calls a c++ function and passes all the parameters using a table:
> key/value pairs). How do I iterate on that table (present on the top
> of stack) in c++? I need both elements (key and value).
Here's the manual section you want:
It describes the table traversal succinctly and mentions a caveat about
converting keys to strings that you should know about.