Hello all.
I am new here, but am hoping that someone may be able to help me with this one. I've moved over to C from Java, am
following a few tutorials and have started learning about binary, hex and data manipulation.
One of the examples calls for a program that will identify a 16-bit number and report true if that number is 1.
So far I have:
Code:
int bitident(int n, int b)
if(b == 000000000000001) {
n = 1 }
return n
else {
n = 0 }
return n
but this seems to me to be too simple and vague. I'm not sure how to code into the 16-bit idea, as what is to stop anyone just putting in "1" and the program returning that as true?
I'm partially sighted and do find net navigation difficult at times, so if this has been posted and answered elsewhere on the board please forgive the discretion.
Your help would be verey much appreciated. I'm keen to understand and learn.
Thanks very much in advance.
Hussein - aka PCHolic.