[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: String equality?
- From: "Mark Meijer" <meijer78@...>
- Date: Mon, 05 Dec 2005 16:42:39 +0000
From: Chris Marrin <email@example.com>
But this is guaranteed to fail, isn't it? A Lua originated string is never
going to have the same pointer as a C-generated string, right?
Erm, yes, I am an idiot :-D Those two pointers are pretty much guaranteed
NOT to be equal *shames* What I meant was the equality check with your "foo"
atom, as you described in the original topic:
And I will store the string pointer as the value of the atom. Now I want to
if (lua_tostring(L, -1) == myFooAtom) // the strings match!
There you could add the || and strcmp to prevent your code from breaking in
case pointer equality is not guaranteed, is what I meant. I'm not sure if
this is a practical solution for your atom table in general, was rather just