Results 1 to 5 of 5

Thread: convert char to hex, please help.. [Solved]

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    8
    Thanked 133 Times in 128 Posts

    Default Re: convert char to hex, please help..

    Qt Code:
    1. QString s="ABC";
    2. int len=s.length();
    3. int sum=0;
    4. QChar ch;
    5. for(int i=0;i<len;i++)
    6. {
    7. ch= s.at(i);
    8. sum+=ch.unicode();
    9. }
    To copy to clipboard, switch view to plain text mode 

  2. The following 2 users say thank you to nish for this useful post:

    cooper (16th July 2009), zeFree (30th April 2013)

Similar Threads

  1. Char array[6] to QString and display it
    By arunvv in forum Newbie
    Replies: 11
    Last Post: 12th March 2014, 20:48
  2. convert unsigned char * to QString
    By sepehr in forum Qt Programming
    Replies: 4
    Last Post: 9th December 2008, 20:31
  3. convert from qstring to const char *
    By deepa.selvaraj in forum Qt Programming
    Replies: 3
    Last Post: 28th November 2007, 12:33
  4. How to convert QString to char *
    By rajeshs in forum Qt Programming
    Replies: 7
    Last Post: 27th September 2007, 10:32
  5. unable to save QCStrings properly in a buffer
    By nass in forum Qt Programming
    Replies: 13
    Last Post: 15th November 2006, 20: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
  •  
Qt is a trademark of The Qt Company.