×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Smile Conversion from string to unsigned char[]

    Hi All,

    I want to conversion from string to unsigned char[]..

    I am getting string, which contains bytes something like..
    20,30,50,122,234,
    i want to store it in to unsigned char[] like

    unsigned char cipher[len] = {20,30,50,122,234}
    PLz help me.. atleast give some hint so i can go further
    Thanks
    Kalgi Modi

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Conversion from string to unsigned char[]

    as this is under Symbian C++, I suppose the conversion is from descriptor to char, thus check this wiki article: http://www.developer.nokia.com/Commu...and_Vice_Versa

  3. #3
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: Conversion from string to unsigned char[]

    hi yucca, thanks for the reply..

    But this string contains , i want to seprate the string from comma

    and need to strore into another array.. after that i can store the values in to unsigned char array..

    How can i do that ?
    Thanks
    Kalgi Modi

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Conversion from string to unsigned char[]

    i want to seprate the string from comma
    You can make use of Find() & Mid().

  5. #5
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: Conversion from string to unsigned char[]

    Hi not_dying thanks for your answer..

    I have taken all values to CDescArray with the help of find & Mid functions.. Now i want to convert this array to unsigned char[]..

    How can i do that ?
    Plz help..
    Thanks
    Kalgi Modi

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    India
    Posts
    1,173

    Re: Conversion from string to unsigned char[]

    Did you checked the link suggested by Yucca in post # 2?

  7. #7
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: Conversion from string to unsigned char[]

    Yes i have checked that link.. but m really confuse how do i type cast to convert CDescArray to unsigned char array ..

    Plz guide me..
    Thanks
    Kalgi Modi

  8. #8
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Conversion from string to unsigned char[]

    You could check the SDK docs, for example see what MdcaPoint function returns.

  9. #9
    Regular Contributor
    Join Date
    Jan 2009
    Posts
    224

    Re: Conversion from string to unsigned char[]

    yucca,

    I have checked MdcaPoint, function returns TPtrC8 (m using CDesC8Array) .. But still m not getting how can i convert TPtrC8 to unsigned char[]..

    help me out, m really stuck over here..
    Thanks
    Kalgi Modi

  10. #10
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Conversion from string to unsigned char[]

    the previous link I gave has the descriptorToStringL function that can convert one descriptor to char, thus have you considered trying it.

Similar Threads

  1. Replies: 6
    Last Post: 2011-06-30, 12:41
  2. Conversion from minus double value to String
    By archikong in forum Symbian
    Replies: 1
    Last Post: 2009-02-12, 22:59
  3. unsigned char * to TDes
    By Kavit Patel in forum Symbian
    Replies: 8
    Last Post: 2008-10-07, 21:35
  4. Conversion from signed 2 unsigned
    By Shaddy_ in forum Symbian
    Replies: 1
    Last Post: 2007-03-12, 10:55
  5. Unsigned char to CFbsBitmap
    By Lee2 in forum Symbian
    Replies: 2
    Last Post: 2006-08-17, 06:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×