Results 1 to 3 of 3

Thread: conversion between string to hex and vice versa

  1. #1
    Join Date
    Oct 2009
    Location
    chennai,india
    Posts
    66
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Smile conversion between string to hex and vice versa

    hi
    i am having a string like,
    QString str="01deff";
    and i want to convert into hex like ,
    char val[3];
    val[0]=0x01;
    val[1]=0xde;
    val[2]=0xff;

    and i need the vice versa,ie
    char val[3];
    val[0]=0x01;
    val[1]=0xde;
    val[2]=0xff;

    to
    QString str="01deff";
    pls can any one help me?
    thanks

  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 between string to hex and vice versa


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

    mohanakrishnan (5th December 2009)

  4. #3
    Join Date
    Oct 2009
    Location
    chennai,india
    Posts
    66
    Thanks
    18
    Qt products
    Qt4
    Platforms
    Windows

    Smile Re: conversion between string to hex and vice versa

    hi Lykurg
    i ll try and with ur ideas and come back
    thanks...

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.