lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Hi Adam

Thanks for answering my post :)

Just so I get this straight....

If we create a pointer:

int * foo

no memory has been taken but when foo is assigned a value it is:
foo = 2 ;
foo can be passed to functions but the value it points to is not, foo is passed by reference.

The type of pointer will tell the compiler how many bytes to reserve in the address space during assignment.

If we do the same with lua_State * foo

Is it again just a matter of bytes and that the actual types that the memory will hold are not vitally important, only that enough have been reserved for what will be assigned to the location?

I get a warning with this but it compiles

int main(void)
lua_State *L;
L = 1 ;
return 0;

Thanks again