cocos2d-x 读取沙盒文件的方法
std::string fullPath = CCFileUtils::fullPathFromRelativePath("find.txt");
unsigned char* pBuffer = NULL;
unsigned long bufferSize = 0;
pBuffer = CCFileUtils::getFileData(fullPath.c_str(), "r", &bufferSize);
CCLog("%ld",bufferSize);
for (int i = 0; i < bufferSize; ++i)
{
CCLog("%c",pBuffer[i]);
}
if (pBuffer)
{
delete [] pBuffer;
pBuffer = NULL;
补充:移动开发 , 其他 ,