Advertisement Jump to content
Sign in to follow this  
Exponent

Question about lua/luabind and arrays

This topic is 4919 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. Let's say for example I have a c++ function which accepts as its paramater an array of bytes (unsigned char*) Using lua, how would I pass this as a paramater to my c++ function (which is exposed to lua)? Remembering, that 0 could be one of the bytes in the array, could I just go '\3\4\2\0\2\3' and so on? Also, in lua, is it possible to represent these bytes in hex, something similar to the c++ \x1F or 0x1F. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
I believe everything you need is in section 2.1 of the manual, and that the \3\4 (etc...) approach looks correct. I don't think you can use hexadecimal.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!