accelProps.xAxis is a 32 bit integer reading from an accelerometer...
Int16U xVal = accelProps.xAxis;
Will the above copy the first 16 bits of the 32 bit integer into the 16 bit integer?
This is a discussion on Copying 32 bits into 16 bit integer??? within the C Programming forums, part of the General Programming Boards category; accelProps.xAxis is a 32 bit integer reading from an accelerometer... Int16U xVal = accelProps.xAxis; Will the above copy the first ...
accelProps.xAxis is a 32 bit integer reading from an accelerometer...
Int16U xVal = accelProps.xAxis;
Will the above copy the first 16 bits of the 32 bit integer into the 16 bit integer?
If by 'first', you mean 'least significant', then yes.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I support http://www.ukip.org/ as the first necessary step to a free Europe.
Thanks!!
Isn't this implementation defined, however? Truncation?
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^