×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    78

    char signed/unsigned

    Hei

    Another short one

    If i have pointer

    char *p;

    and it points to 0xff,

    in maemo (symbian also) : int a = *p: // a= 255
    in win/mac: int a = *p: // a= -1

    This gives lot of harms if not known, workaround:

    if(a>127) a-=256;

    Hannu

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: char signed/unsigned

    This gives lot of harms if not known
    True. So it's one of those things in C/C++ that you need to know.

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: char signed/unsigned

    (There are simpler/cheaper work-arounds.)

Similar Threads

  1. unsigned char * to TDes
    By Kavit Patel in forum Symbian
    Replies: 8
    Last Post: 2008-10-07, 21:35
  2. How to Convert TDes to unsigned char*?
    By strike_noir in forum Symbian
    Replies: 5
    Last Post: 2007-12-11, 13:28
  3. unsigned char array length
    By bharatuppal in forum Symbian
    Replies: 1
    Last Post: 2007-02-15, 18:01
  4. Unsigned char to CFbsBitmap
    By Lee2 in forum Symbian
    Replies: 2
    Last Post: 2006-08-17, 06:36
  5. unsigned char to hex
    By nicholasgaye in forum Symbian
    Replies: 0
    Last Post: 2005-06-09, 13:14

Posting Permissions

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