If you're using FFI and the proc accepts cstring type, you don't even need to
convert string to cstring at all:
proc printf(formatstr: cstring) {.importc: "printf", varargs, header:
"<stdio.h>".}
printf("This works %s", "as expected")
- How to get the address of string "" slangmgh
- Re: How to get the address of string "" yglukhov
- Re: How to get the address of string "" c0ntribut0r
- Re: How to get the address of string "" slangmgh
- Re: How to get the address of string "&q... c0ntribut0r
