Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to do shift calucation for qint16 data type?
small_bird last edited by
Hello everyone! I 'd like to ask one question as the title.
qint16 a=99; a>>2
Above is the code I write, however, the value of a is still 99! Why? Does not qtint16 support shift calucation?
a = a>>2;
"Does not qtint16 support shift calucation?" - it does, you just need to assign the result to the same variable.
<< and >> do not change the variable itself.
VRonin last edited by
@jsulm There is also
@VRonin Yes, I know just wanted to show the "full" version :-)