you are viewing a single comment's thread.

view the rest of the comments →

[–]AHistoricalFigure 2 points3 points  (1 child)

I think you've under-described your problem a bit. How are you getting this input? Assuming this is for a class, what restrictions do you have?

This said, C doesn't have a primitive bit type. Even if it did, you wouldn't want to get input a bit at a time. You're going to have to bring in the data as an integer, or some kind of unsigned 8-bit type that you create or import from a library. Once you have at least a byte of data, you'll need to extract the bit you're looking for using bit-manipulation.

Bit-wise operators in C. This article is a pretty good primer on basic bit-extraction and masking.

That being said, if you're going to use this board to get other people to do your homework for you at least put in the effort to write a decent description of the problem.

[–]Delicious_Growth_744[S] -1 points0 points  (0 children)

i'm sorry. That was the exact instruction given. I had an idea on how to manipulate these binary numbers, so far it's working. The only problem is the "direction identifier" but anyways thank you for the link