3 ms·
"int" is signed unless you specify "unsigned". So "static int" would be a signed int that is also static. Also, I see no reason why it would crash. Once it ge
by drivers99 13y ago
"int" is signed unless you specify "unsigned". So "static int" would be a signed int that is also static.
Also, I see no reason why it would crash. Once it gets to the max value, incrementing would return some other value but I've never seen C produce a runtime error for an integer overflow.
- tompko 13y agoTechnically an overflow on a signed variable results in undefined behaviour so it could crash out, but all the compilers I've tried just wrap around.