Closed
Description
There's already b"foo"
syntax for [u8]
literals and I've seen talk of adding s"foo"
for String
literals (perhaps through a syntax extension). If we're going down that path we could also add c"foo"
syntax which could be either a CString
or a *const i8
. This would be useful for interacting with foreign C code. Currently, to call a C function with a string constant I'm using
foo(b"my string\0".as_ptr() as *const i8)
But that's a little cumbersome (and error-prone if I accidentally leave the NUL off).