Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > unsigned short, short literals

Reply
Thread Tools

unsigned short, short literals

 
 
Ioannis Vranos
Guest
Posts: n/a
 
      03-04-2008
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?
 
Reply With Quote
 
 
 
 
Peter Nilsson
Guest
Posts: n/a
 
      03-04-2008
Ioannis Vranos <(E-Mail Removed)> wrote:
> 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.

--
Peter
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      03-04-2008
In article <fqkhnt$1uen$(E-Mail Removed)>,
Ioannis Vranos <(E-Mail Removed)> wrote:
>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.
--
"Any sufficiently advanced bug is indistinguishable from a feature."
-- Rich Kulawiec
 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      03-04-2008
Ioannis Vranos wrote:
> 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.

--
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
Walter Roberson
Guest
Posts: n/a
 
      03-04-2008
In article <1204670350.225716@news1nwk>,
Eric Sosman <(E-Mail Removed)> wrote:
>Ioannis Vranos wrote:
>> 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.


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
--
"The art of storytelling is reaching its end because the epic
side of truth, wisdom, is dying out." -- Walter Benjamin
 
Reply With Quote
 
Eric Sosman
Guest
Posts: n/a
 
      03-05-2008
Walter Roberson wrote:
> In article <1204670350.225716@news1nwk>,
> Eric Sosman <(E-Mail Removed)> wrote:
>> Ioannis Vranos wrote:
>>> 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.

>
> 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.

--
Eric Sosman
(E-Mail Removed)lid
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(int) -> (unsigned) -> (int) or (unsigned) -> (int) -> (unsigned):I'll loose something? pozz C Programming 12 03-20-2011 11:32 PM
How to combine 2 unsigned short into a unsigned int? fancyerii Java 21 11-05-2007 09:33 PM
I want unsigned char * string literals Michael B Allen C Programming 43 08-26-2007 07:18 AM
unsigned short short? slougheed@gmail.com C++ 4 10-16-2006 11:25 PM
Java: byte literals and short literals John Goche Java 8 01-17-2006 11:12 PM



Advertisments