read text file

read text file
0.0 0


in trying to read a file that i put in resource folder

    FILE *fp = fopen("dictionary.txt", "r");
    char buf[50] = {0};
    fgets(buf, 50, fp);
    CCLabelTTF* pLabel = CCLabelTTF::labelWithString(buf, "Arial", 24);

this works fine in windows but crashes in android,

    std::string textFileName = "dictionary.txt";
    textFileName = cocos2d::CCFileUtils::fullPathFromRelativePath(textFileName.c_str());
    cocos2d::CCFileData data(textFileName.c_str(), "r");
        unsigned long nSize = data.getSize();
        unsigned char* pBuffer = data.getBuffer();

works but i need to read the file line by line.
i tested cocos2d::CCFileUtils::fullPathFromRelativePath and it gives “dictionary.txt” while in android so i think the path is ok.


so im still trying to make my own method to read the files, looks like i need to make my own CCFileUtils::getFileDataFromZip and unzReadCurrentFile, the problem i have is i can’t find from where CCFileUtils::setResourcePath is called. what is the resource path of the .apk files ? /data/data/