fpco / inline-c

284 stars 50 forks source link

Null terminated strings Question #68

Closed tolysz closed 5 years ago

tolysz commented 6 years ago

What is the best way of converting Haskell Strings into null terminated c strings i.e. char *?

I could add \0 and convert into bytestring and usre $bs-ptr:

nh2 commented 5 years ago

Does withCString solve it for you?

tolysz commented 5 years ago

Thanks, yes, it could work. Personally I like the anti-quoter approach for the marshalling.