lua-users wiki: Simple Lua Api Example

lua-users wiki: Simple Lua Api Example

lua-users home

This is a simple introductory example of how to interface to Lua from C. The C program loads a Lua script file, sets some Lua variables, runs the Lua script, and reads back the return value. The below example works with Lua 5.3.

First, create the below Lua script file and save it as “script.lua”. This script will dump to the screen the contents of a table named “foo” (that will be created from the C…

Read the entire article at the source link…

#codango #developer #development #coder #coding

We're happy to share this resource that we found. The content displayed on this page is property of it's original author and/or their organization.


Leave a Reply

Your email address will not be published. Required fields are marked *