Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How we can add integers?
I code the following but got only one number after summing ;
bool ok; qint32 decc =Rx_CF_read.toInt(&ok,16); qDebug()<<"RX LO:"<<decc; bool ook; qint32 dec = df.toInt(&ook,16); qDebug()<<"Detected:"<<dec; qint32 sum= decc + dec; qDebug()<<"sum is:"<<sum;
@Wasee thats most certainly not the code/output you actually have.
2464999998 does not fit into an int32! it becomes -1829967298
You should check if 'ok' returns true - why do you pass it to toInt() but don't check it afterwards?
And your output does not match your code - toInt() will return 0 when the range does not fit so you can not get an output of
I check you suggested but I am unable to add them.
but I am unable to add them
Please be so kind and explain what you did and what does not work.
Or do you expect us to guess?
mpergand last edited by mpergand
2^32 4294967296 int(2^32) -2147483648 int(2464999998) -2147483648
INT_MIN Minimum value for a variable of type int . -2147483648
Are you sure your string is in hexa ?