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 <CkZipCrc.h>

void ChilkatSample(void)
    {
    CkZipCrc zipCrc;
    //  Use a relative for absolute path to the file..
    int crc = zipCrc.FileCrc("qa_data/hamlet.xml");
    const char *hexStr = zipCrc.toHex(crc);
    std::cout << hexStr << "\r\n";
    }