I have been playing with defining custom size data types in structures, like 2 or 4 bit and stuff.

But ignoring structures i have enev been having trouble getting data read from a file into standard variables and display as that type of variable correctly. If i input 8 bit i am going to get some sort of char(or cr form feed, not good example, even null i guess). But even inputing in a standard int and using sizeof() or not when i try to travers the whole file and read the bits as a bunch of ints i cannot seem to gather all the bits. I understand using char whould screw things up but an int WILL be a number regardless of the bits.

Should I be using ifstream.get() or ifstream.read(). Niether seem to work right. Is there something i need to do to contron the file pointer? I was under the assumption that unless specified the default is the file pointer stays at the end of the last bit read.

If someone could give me an example or reason i connot seem to capture the correct amout of bits before the end of the file i would be gratefull. Among other things i would like to write a hex editor for fun some day. =)