Decimal To Binary Conversion and Vice-versa
Solved
General and Desktop
-
Im searching Decimal To Binary Conversion function and Vice-versa in Qt.
if any one known please help me.
Thank You. -
Im searching Decimal To Binary Conversion function and Vice-versa in Qt.
if any one known please help me.
Thank You. -
Im searching Decimal To Binary Conversion function and Vice-versa in Qt.
if any one known please help me.
Thank You.@Pranit-Patil
there's always the standart c++ libary -
I got this and its works fine for me
#include <QCoreApplication>
#include <QDebug>
#include <QString>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
bool ok;QString str = "FF"; qDebug()<<"Input (HEX) = " << str; int iVal = str.toInt(&ok,16); QString binnumber = str.setNum(iVal, 2); qDebug()<<"Convert to Int = " << QString::number(iVal); qDebug()<<"Convert to Binary = " << binnumber; return (0);
}