Please a little help with Bits!!!

P

p3tris

help me with this problem. I have stated this:

typedef unsigned short WORD;
struct cube {
WORD t;
WORD f;
};
typedef struct cube CUBE;
CUBE cubes[MAX_VARS+1][MAX_CUBES];

And i have to make a procedure that will read from the keyboard
binaries and activate the .t or .f of cubes array accordingly.
Will activate 1 in .t if if we have 1 in that place, 1 in .f if we have
0 in that place and 0 in both places if that place has a '-'.

EXAMPLE:
IF I INSERT P= 1010001 WILL MAKE:
cubes[0][j].t = (1010001)
cubes[0][j].f = (0101110)

If i put P = 101-001 will make:
cubes[0][j].t = (1010001)
cubes[0][j].f = (0100110)

Please some help would be REALLY appreciated. You can contact me at:

p3tris (at) gmail (dot) com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,968
Members
47,517
Latest member
TashaLzw39

Latest Threads

Top