Unsafe uint++

Is there a way in .NETMF to be able to always increment by 1 to an uint number even if it causes an overflow. I.e. when you +1 to 4,294,967,295 it becomes zero again?

@ Mr. John Smith - I thought overflow does not cause an exception? What’s the problem?

1 Like

I’m pretty sure a byte just overflows to 0 if it goes beyond 255 without an exception, so I think a uint does the same.

Huh, I thought it does. I stand corrected.