Results 1 to 3 of 3

Thread: whats the difference

  1. #1

    Thread Starter
    Fanatic Member nabeels786's Avatar
    Join Date
    Jul 2001
    Location
    New York
    Posts
    919

    whats the difference

    i dont understand the difference between an signed var and an unsigned var. i couldnt find a definition in the book im using


    thanks,
    -nabeel
    Visit www.fragblast.com
    Gaming, forums, and a online RPG/Battle system




    (__Flagg) DOT NET? is this a Hindi Dating service?

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    An unsigned 8-bit integer can have a value of 0 to 255 inclusive. A signed 8-bit integer can have a value of -128 to 127 inclusive. That's the main difference.

    Signed integers are represented using two's complement binary representation, whereas unsigned values are what you will be more familiar with. If you want to know how they differ look up "two's complement".
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Whenever a variable will never hold a negative value, make it unsigned.

Posting Permissions

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



Click Here to Expand Forum to Full Width