Re: newbie: local buf = ffi.new("char[?]", "HELLO WORLD") fails PROBABLY SOLVED

  • From: "Robert G. Jakabosky" <bobby@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 21 Jun 2012 06:25:38 -0700

On Thursday 21, Patrick Masotta wrote:
> I see, good info;
> I need a C string because is going to be altered from the C side then
> casting a LUA string is not an option. in the particular case of "message"
> strings (only for display on the C side)the casting option you mention
> would work but I'm also trying to make life easier to the one that has to
> define these strings providing an homogeneous sytem

Keep in mind that the C side can't grow the char array (no calling realloc) or 
append to it (strcat), since it will be restricted to the length of the 
initial Lua string.

-- 
Robert G. Jakabosky

Other related posts: