[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: RES: RES: C++ Typecast - so far newbie question
- From: Rici Lake <lua@...>
- Date: Mon, 2 Jul 2007 16:23:36 -0500
On 2-Jul-07, at 3:05 PM, SosCpdTerra wrote:
What are you talking about? I cannot pass this return value to a
and typecast into whatever I want? I guess this is the evil!!
If you want a mutable copy of the string, you need to make a copy of
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.
Declare figureout properly:
void figureout(const char *what, int ever)
Functions which take string arguments and do not modify them should not
be declared as taking char *.