Write a simple C program to ++ an int or long variable and see when it overflows.
> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of ext > Tim Kientzle > Sent: Friday, November 21, 2003 12:24 AM > To: Jay Sern Liew > Cc: [EMAIL PROTECTED] > Subject: Re: integer and long max/min values > > > Jay Sern Liew wrote: > > how do I find out the maximum (and minimum) value a long > and int will hold > > in C? (before it overflows or underflows) > > #include <limits.h> > > INT_MAX and INT_MIN are the max/min values for an int > LONG_MAX and LONG_MIN are the max/min values for long. > > Also, see stdint.h, which is defined in C99. > > Also, buy a good C reference book. ;-) > > Tim Kientzle > > _______________________________________________ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to > "[EMAIL PROTECTED]" > _______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"