Thread: Sums...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    25

    Sums...

    Say i have a variable myvar that is of type unsigned char,
    what happens if the variable = 200 and then i sum it 200,
    will it be 256 or 200?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    If an unsigned char has the value of 200, and then 200 is added to it, the result will roll over. It would then equal 144 since 400 - 256 = 144.

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    25
    oh ok thanks

  4. #4
    Registered User
    Join Date
    Oct 2004
    Posts
    25
    is that standard?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Arrays & Sums
    By mrlooneytoon in forum C Programming
    Replies: 9
    Last Post: 04-05-2007, 06:35 PM
  2. Stringy Sums
    By bumfluff in forum C++ Programming
    Replies: 14
    Last Post: 05-15-2006, 01:52 AM
  3. Calculating Sums
    By faxtoaster in forum C Programming
    Replies: 3
    Last Post: 07-10-2003, 08:23 PM
  4. Sums of an array ??
    By RedRattler in forum C Programming
    Replies: 2
    Last Post: 04-04-2003, 08:23 PM
  5. C++ problem w/ sums
    By Kaoru in forum C++ Programming
    Replies: 5
    Last Post: 09-16-2002, 01:15 PM