2009-07-17, 07:36 PM
Devil's Sunrise Wrote:Thing is, it's easier to refer to the bit through this, correct?No, it's not any easier than the below code. In fact, I think the code below is more explicit about what it's doing and thus easier to read.
Code:(un)signed whatever n = x;
int bitnumber = y;
cout << x[bitnumber];
x[bitnumber] = 1;
Code:
(un)signed whatever n = x;
int bitnumber = y;
cout << getbit(n, bitnmber);
setbit(n, bitnumber, true);
