unsigned short, short literals

I

Ioannis Vranos

AFAIK, there aren't any character designations for short and unsigned
short literals, like UL/ul are for unsigned long literals, under
C90/C95, right?
 
P

Peter Nilsson

Ioannis Vranos said:
AFAIK, there aren't any character designations for short
and unsigned short literals, like UL/ul are for unsigned
long literals, under C90/C95, right?

Right. Since they're subject to integral promotion, there's
little need. Longs on the other hand do need something.
Consider 1ul << 17.
 
W

Walter Roberson

AFAIK, there aren't any character designations for short and unsigned
short literals, like UL/ul are for unsigned long literals, under
C90/C95, right?

Correct at least for C89, but C89 does have F and f as suffixes
to designate float values as distinct from double or long double.
 
E

Eric Sosman

Ioannis said:
AFAIK, there aren't any character designations for short and unsigned
short literals, like UL/ul are for unsigned long literals, under
C90/C95, right?

Right. There's no literal whose type is any flavor of
short or of char, or of anything else of lower rank than int.
 
W

Walter Roberson

Right. There's no literal whose type is any flavor of
short or of char, or of anything else of lower rank than int.

There is the L prefix for wide char and wide string.

L'\123'
L"xyz"

C89 3.1.3.4 and C89 3.1.4
 
E

Eric Sosman

Walter said:
There is the L prefix for wide char and wide string.

L'\123'
L"xyz"

C89 3.1.3.4 and C89 3.1.4

Thanks; I had forgotten wide char. As for wide string,
though, the literal (if not used as an initializer) has the
type `array[N] of wchar_t', and the array does not have rank.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top