0

我有代码在运行校验和函数后获取值,我在控制台中打印 CRC 值,但我不知道如何将其保存到文本文件中。这是我的代码:

    unsigned int crc[2];
        NSString *pathText =[ NSString stringWithFormat:@"%@/abc",url ];
        char *cfilename=[pathText UTF8String];
        checksum(cfilename, &crc[0]);
        printf("%08X%08X\n", crc[1], crc[0]);// print it to console
//
 NSString *xml_checksum = checksum(cfilenameXML, &crc[0]);

    //write to file
    [xml_checksum writeToFile:filepath atomically:YES encoding:NSUnicodeStringEncoding error:&error];

你帮我吗?提前致谢

4

0 回答 0