Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does C language judge whether the number string is beyond the shaping range after being converted into an integer?
How does C language judge whether the number string is beyond the shaping range after being converted into an integer?
Assuming that your converted integer is of type int, you only need to judge whether ((I>0& & ampi+1< 0)| |(I & lt; 0 & amp& ampI- 1 & gt; 0)) printf ("data overflow \ n");