tags:

views:

119

answers:

1

I have this constant:

#define MAX_DATE  2958465L

What does the L mean in this sense?

+9  A: 

It is a long integer literal.

Integer literals have a type of int by default; the L suffix gives it a type of long (Note that if the value cannot be represented by an int, then the literal will have a type of long even without the suffix).

James McNellis
Sure? AFAIK literals without the 'L' suffix are of integer type in C++, and it will fail to compile if the literal will not fit in the int type.
David Rodríguez - dribeas
@David: "If it is decimal and has no suffix, it has the first of these types in which its value can be represented: `int`, `long int` (C++03 §2.13.1/2).
James McNellis
Thanks for the quote.
David Rodríguez - dribeas