I can provide an example, sure. mike_g has presented one also.
Code:
#include <stdio.h>
#include <limits.h>
void count ( long first, long last )
{
long c;
for ( c = first; c <= last; c++ )
printf( " %d", c );
putchar( '\n' );
}
int main( void )
{
/** Each of these counting examples probably has problems with integer overflow because
* the last number that breaks the count will overflow the limits of a long integer,
* resulting in a loop that is perpetually true.
* As I've been saying, you need to make sure that [first, last] is within
* the range of a long, or whatever integral you choose.
*/
count( LONG_MIN, LONG_MAX );
count( 0, LONG_MAX );
count( INT_MIN, INT_MAX ); /** Also overflows if sizeof int == sizeof long **/
return 0;
}