I have a binary file of 5 bit numbers in a row that I need to read into an array of unsigned integers where each array value is one 5 bit binary number. I know you can use fread when the values are 1 byte in size, but here the numbers are too small, how should I go about this?
I have just tried using fread but this returns incorrect 8 bit values with a bunch of empty entries at the end of the array.