You give this function a pointer and how many bytes you want to extract as a decimal and it returns it.long longbyte_extract(void * source, size_t bytes){    long long num = 0, m = 1;    size_t i;    for(i = 0; i != bytes; i++)    {        num += (((unsigned char*)source)[i]*m);        m<<=0x8;    }    return num;}
Function to extract bytes as a decimal
c;file;io;integer;serialization
It does the job, so that's good. It's quite clear and I don't see fundamental flaws in it. There are a few minor things I'd recommend to change:The most important expression in the middle is a bit hard to read.I find it much easier this way: num += m * ((unsigned char*) source)[i];(Redundant parens removed, multiplication operands switched, minor spacing adjustments)Instead of m<<=0x8; I would write m <<= 8; with more spacing and 0x8 is the same as simply 8The name byte_extract doesn't convey well what you described: You give this function a pointer and how many bytes you want to extract as a decimal and it returns it. extract_num or extract_bytes_as_num would be betterRenaming m to multiplier could be a good idea too