3 ms·
size_t is covered within the first 50 pages of C++ Primer. incorrect behavior is incorrect behavior. You want it to crash when you decrement past some value, i
by blah32497 13y ago
size_t is covered within the first 50 pages of C++ Primer.
incorrect behavior is incorrect behavior. You want it to crash when you decrement past some value, instead it does something that looks like crazy voodoo to you (from a boolean algebra perspective this is completely expected behavior! You're just loosing the top binary digit b/c you have nowhere to store it!)
We don't program to make programs crash. Yeah, it's a slightly easier to debug when you have a crash, but never bet on crashing or segfaulting for "checking" if your program works.