If I have .txt file include 10 digits such as
0//start bit
1
1
0
0
0
0
1
0//parity bit
1//end bit

If I put those into an array, how to check the first bit, the last bit and parity bit?
How to convert the mid 7 digits in to a character?

I'm very poor in C please help me.
I've got a lot of questions, it would be better if you leave your email:)

kind regards

If your using bits then maybe you should consider a structure with bits fields.

struct my_bits
{
  unsigned int one:1;
  unsigned int two:1;
  unsigned int three:1;
  unsigned int four:1;
  unsigned int five:1;
  unsigned int six:1;
  unsigned int seven:1;
  unsigned int eight:1;
  unsigned int nine:1;
  unsigned int ten:1;
};

If I have .txt file include 10 digits such as
0//start bit
1
1
0
0
0
0
1
0//parity bit
1//end bit

If I put those into an array, how to check the first bit, the last bit and parity bit?

When you've read the data into your array, what's the index of the first bit, the last bit, and the parity bit?

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.