Results 1 to 4 of 4

Thread: Conversion to hexadecimal

  1. #1
    Join Date
    Nov 2011
    Posts
    7
    Thanks
    2
    Qt products
    Qt4

    Default Conversion to hexadecimal

    How to show the conversion of 1387977189696842278 to 134315e67439aa26 using C++?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Conversion to hexadecimal

    Well, a quick lookup in the docs could have solved your problem...
    Qt Code:
    1. quint64 i = 1387977189696842278;
    2. QString str = QString("Decimal %1 is %2 in hexadecimal")
    3. .arg(i)
    4. .arg(i, 0, 16);
    5. qWarning() << str;
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Lykurg for this useful post:

    vidya.p (13th December 2011)

  4. #3
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Conversion to hexadecimal

    Hi,
    If you want use Qt, you can use above code.
    In C++ you must use library can handle big data like biginteger(https://mattmccutchen.net/bigint/) or gmp(http://gmplib.org/).
    So, you can convert your number to HEX with this tutorial link http://www.permadi.com/tutorial/numDecToHex/

    THank you for your attention.

    Best regards,

    Toto

  5. The following user says thank you to myta212 for this useful post:

    vidya.p (13th December 2011)

  6. #4
    Join Date
    Nov 2011
    Posts
    7
    Thanks
    2
    Qt products
    Qt4

    Default Re: Conversion to hexadecimal

    thanks for the help.

Similar Threads

  1. LineEdit for Hexadecimal input
    By mastupristi in forum Qt Programming
    Replies: 2
    Last Post: 21st January 2010, 14:51
  2. storing data in hexadecimal format
    By aj2903 in forum Qt Programming
    Replies: 6
    Last Post: 13th January 2010, 05:29
  3. how to process hexadecimal
    By mohanakrishnan in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2009, 04:33
  4. Replies: 4
    Last Post: 22nd August 2008, 10:08
  5. converting the value from hexadecimal to decimal value
    By jjbabu in forum Qt Programming
    Replies: 2
    Last Post: 16th November 2007, 10:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.