[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: how to get value of a lua variable into a C program variable.
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 25 Jan 2002 10:16:02 -0200
> can anyone help me out there. i wrote a program in C
>to send a string a=2;b=a+1. , now i want to get the
>value of b into the C program variable called d, so
>that i can do a printf() of the value of d in C
lua_dostring(L, "a=2;b=a+1");
lua_getglobal(L,"b");
d=lua_tonumber(L,-1);
--lhf