Sample code for 30+ languages & platforms
C

Compute CRC32 of a File

Calculates the CRC32 of a file's contents and returns the 32-bit CRC as a hex string.

Chilkat C Downloads

C
#include <C_CkZipCrc.h>

void ChilkatSample(void)
    {
    HCkZipCrc zipCrc;
    int crc;
    const char *hexStr;

    zipCrc = CkZipCrc_Create();
    //  Use a relative for absolute path to the file..
    crc = CkZipCrc_FileCrc(zipCrc,"qa_data/hamlet.xml");
    hexStr = CkZipCrc_toHex(zipCrc,crc);
    printf("%s\n",hexStr);


    CkZipCrc_Dispose(zipCrc);

    }