Hi everyone,
Consider the below program
Now from what i understand 1 byte is 8 bits so the maximum is all 1's (ie. 255).
The above first function ByteTest1 i cast the hexadecimal a byte as so
Now why do i have to cast it even when 0x9C is well below 255 but if i do not cast it the compiler complains saying that it is an integer.
The above second function ByteTest2 i did not cast the hexadecimal a byte as so
Now why is it that the compiler accepts the hexadecimal value 0x5A without any casting but for 0x9C the compiler emit errors saying it is an integer?
Am i missing something?
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West
Consider the below program
Now from what i understand 1 byte is 8 bits so the maximum is all 1's (ie. 255).
The above first function ByteTest1 i cast the hexadecimal a byte as so
Now why do i have to cast it even when 0x9C is well below 255 but if i do not cast it the compiler complains saying that it is an integer.
The above second function ByteTest2 i did not cast the hexadecimal a byte as so
Now why is it that the compiler accepts the hexadecimal value 0x5A without any casting but for 0x9C the compiler emit errors saying it is an integer?
Am i missing something?
Any help is greatly appreciated
Thank You
Yours Sincerely
Richard West