Witam, chciałbym dowiedzieć sie dlaczego jak w strukturze zmniejszę zakres zmiennych do 4 bitów to liczba w zmiennej unsigned jest podawana prawidłowo a w signed nie ??
#include <QCoreApplication>
#include <QDebug>
struct testowa
{
unsigned int pole:4;
signed int pole2:4;
};
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
testowa nowa = {15, 15};
qDebug() << " Unsigned : " << nowa.pole << endl;
qDebug() << " Signed : " << nowa.pole2 << endl;
return a.exec();
}