Read it in as a string instead of as a number. Then you can do strlen on it, and you can use atoi and other functions if the length is short enough, or you can use your own custom functions to convert it into some binary representation if it won't fit into the C types.