Update: This question is no longer relevant anymore because CString
has been removed in Xcode 6 beta 4.
In C, I can pass a C string (const char *
) to a C function that takes varargs.
Now I want to do the same thing in Swift given a CString
. I know that in Swift I cannot access C varargs functions directly, but I can access C functions that take a va_list
, which in Swift becomes CVaListPointer
, and I can make that with getVaList()
from an array of CVarArg
, as per this question.
I can successfully put integers (Int
) and objects (NSObject
) into the CVarArg
array with no problem, but I can't figure out how to get a CString
into a CVarArg
.
Looking through the types that conform to CVarArg
in the standard library, I see that there is a COpaquePointer
, but I can't figure out how to get CString
into that either.