[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RES: RES: C++ Typecast - so far newbie question
- From: "SosCpdTerra" <soscpd@...>
- Date: Mon, 2 Jul 2007 17:05:32 -0300
What are you talking about? I cannot pass this return value to a variable
and typecast into whatever I want? I guess this is the evil!!
I have this
void figureout(char *what, int ever)
and I must his 2 args came from lua. Im trying to do this:
int serial(lua_State *L) //my registered function
int argc = lua_gettop(L);
const char var1 = lua_tostring(L, 1);
int var2 = int(lua_tonumber(L, 2));
There is another way? I can't see that way, and that is my problem.
[mailto:email@example.com] Em nome de Rici Lake
Enviada em: segunda-feira, 2 de julho de 2007 17:58
Para: Lua list
Assunto: Re: RES: C++ Typecast - so far newbie question
On 2-Jul-07, at 2:40 PM, SosCpdTerra wrote:
> Did someone know a better way to typecast a const char * (that is about
> lua_tostring(L, n)) into a char * then vector or c_str()? I'm fighting
Strings returned by lua_tostring *must not be modified*.
So don't cast them to char* or evil things will happen.
__________ NOD32 2371 (20070702) Information __________
This message was checked by NOD32 antivirus system.