简体   繁体   中英

Int turning into negative number

I'm attempting to make a game in which I need to store a large number. I am currently using a int but the number keeps turning negative. Is there a reason this would be happening?

This could be because your value is exceeding the range that a int can store. Try using the long variable rather then int

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM