I have a txt file with continuous binary data. That is: no separators. How do I read 1 bit from this file or read 7 bits come to that.

How do I read 1 bit from this file or read 7 bits come to that.

There isn't a way to read individual bits from a file. You have to read a byte and then extract from it which bit(s) you want.
Use the AND operator with the desired bit(s) on to select the bits you want.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.