Results 1 to 2 of 2

Thread: convert string to byte values

  1. #1
    Join Date
    May 2007
    Posts
    301
    Thanks
    46
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default convert string to byte values

    Hi,

    If I have a QString with the following inside it :

    "CC13FF87A4EE76BA"

    I want to extract as :

    CC
    13
    FF
    87
    A4
    EE
    76
    BA

    Then convert each one to its byte value, thus ascii "CC" would be (byte) 0xCC, etc...Is there a fast way of doing this?

    Regards,
    Steve

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: convert string to byte values

    Yes it is.
    Please first take a look into the Documentation of QString!

Similar Threads

  1. How to convert from QString to string ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 1st December 2010, 01:50
  2. Convert from QByteArray to String ?
    By probine in forum Newbie
    Replies: 3
    Last Post: 25th March 2006, 15:49

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.