I want to use a C function in Swift, which has the following method definition:
int startTest(char *test1, char* test2) If I call this method from my Swift code like this
startTest("test1", "test2") I get the following error message:
'String' is not convertible to 'UnsafeMutablePointer<Int8>' If I change my method definition to:
int startTest(const char *test1, const char* test2) and call that method like this:
var test1 = "test1" var test2 = "test2" startTest(&test1, &test2) I get
'String' is not identical to 'Int8' So my question is: how can I use the C function? (it is part of a library, so changing the method call could be problematic).
Thanks in advance!
char *and/orconst char *. Perhaps consider editing?