Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Why use signed integers?

Name: Anonymous 2012-09-26 12:17

I've noticed that, in quite a few MMORPGs, the stackable item/money cap is (2^31)-1, or 2,147,483,647.

But why use a signed integer? Do you really need negative amounts of items?

Why not use unsigned integers and then have the cap be (2^32)-1?

Name: Anonymous 2012-09-26 13:44

>>9
The compiler could change the type and still comply with the standard in code like this:
for(int i = 0; i < 100; ++i) {
  /* some code that doesn't modify or take the address of i */
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List