what does "uint8_t" or "uint16_t" mean?
Can you tel me output of following statement if you can then please explain ?
TWI_SLA_CAM=0xC0
uint8_t sla;
uint16_t eeaddr=0x12;
sla = TWI_SLA_CAM |(((eeaddr >> 8) & 0x07) << 1);
what does "uint8_t" or "uint16_t" mean?
Can you tel me output of following statement if you can then please explain ?
TWI_SLA_CAM=0xC0
uint8_t sla;
uint16_t eeaddr=0x12;
sla = TWI_SLA_CAM |(((eeaddr >> 8) & 0x07) << 1);
uint8_t is unsigned type containing 8 bits (on most compilers unsigned char will do)
uint16_t is unsigned type containing 16 bits - on most compilers unsigned short will do the work
What do YOU think will be the output?
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
i am not able to get wat
"eeaddr>> 8"
do ,bcoz eeaddr =0x12 even after being uint16_t
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
I am unable to figure out how a uint16_t eeaddr be shifted to right by 8 bits, becoz the value stored in eeaddr is 0x12, thus shifting it by 8 bits gives 0.
and finally gives sla=0xc0; that is TWI_SLA_CAM