Hi All,
I m using QT 4.1.5 on my MAC.
I have a QString to which I want to Encode to Numbers and then want to write it to a file.
So if anyone know how I can do it then plz help me.
Thanks.
Hi All,
I m using QT 4.1.5 on my MAC.
I have a QString to which I want to Encode to Numbers and then want to write it to a file.
So if anyone know how I can do it then plz help me.
Thanks.
For QStrings there is a toInt( ) (or toDouble( ), etc) function that will convert the string to the appropriate number.
http://doc.trolltech.com/4.1/qstring.html#toInt
To convert a number into a string, there is a static function QString::number( int num, int base ) http://doc.trolltech.com/4.1/qstring.html#number that returns a QString.
Thanks for Reply.
But I want Encoding of QString to number as
If I have a QString like QT CENTER then it will encode it to something like 275161967.
What kind of encoding would you like to use?
Any type of encoding.
It should be simple or complex.
How did you compute that number for QT CENTRE?
For a given char you can get its unicode code with QChar::unicode();
Maybe you can use that unique value to build a number from a string.
Regards
Bookmarks