I have a library which has a function like this:
int get_user_name(const char **buffer);
in swift, should call like this:
var name:CMutablePointer<CString> = nil
get_user_name(name)
I want make use this function more comfortable so I wrapped this up:
func get_username() -> String {
var name:CMutablePointer<CString> = nil
get_user_name(name)
// how to convert name to String
}
I question is how to convert name to String