Some differences would be noticeable on a platform that has different sized ints and longs when the constant is used in an expression.
Code:
#include <stdio.h>
int main(void)
{
long a = 32000 * 4, b = 32000 * 4L, c = 32000L * 4, d = 32000L * 4L, e;
printf("sizeof(2) = %lu\n", (long unsigned)sizeof(2));
printf("sizeof(2L) = %lu\n", (long unsigned)sizeof(2L));
printf("a = %ld, b = %ld, c = %ld, d = %ld\n", a, b, c, d);
e = 1 << 16; printf("e = %ld\n", e);
e = 1L << 16; printf("e = %ld\n", e);
return 0;
}
/* my output
sizeof(2) = 2
sizeof(2L) = 4
a = -3072, b = 128000, c = 128000, d = 128000
e = 0
e = 65536
*/
>i see there are a number of page views. why hasn't anyone responded?
Don't do this (see #5).