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!