Android ndk string处理:ndk-string-test
立即下载
资源介绍:
Android ndk string处理:ndk-string-test
#define _LIBCPP_ABI_VERSION ndk1
#include "NDKHelper.h"
#include
#include
std::string makeNDKString(const char* str) {
return std::string(str);
}
const char* makeCString(const std::string& ndkString) {
char* cString = new char[ndkString.length() + 1];
memset(cString, 0, ndkString.length() + 1);
strcpy(cString, ndkString.c_str());
return cString;
}