|
-
Nov 8th, 2002, 03:52 PM
#1
Thread Starter
Hyperactive Member
32768+1 = -32768 ???
I am just starting with C, and in most languages you get overflow or some error about integer overflow or something....
My question is, why does C go to -32768, and then counts up to 0, then to +32768 again, and it becomes a constant loop.
I thought it would have something to do with binary, and that:
11111
when added, if you only have x spots, it becomes
00000
I may be wrong, but any explanation is appreciated!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|