Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C numerical constant suffix for "short" [duplicate]

Tags:

c

syntax

Possible Duplicate:
How do I write a short literal in C++?

Is there a suffix for short int numerical constants in C? There are u, l, d, and f for unsigned, long, double and float, but I could not find any for short.

I do some very low lever bit meddling and I need numerical constants with the size of 2 bytes. The system I work on guarantees that short ints are 2 bytes, so that is not a problem. It's embedded, so please don't bother with suggestions about portability.

like image 790
vsz Avatar asked Nov 16 '11 10:11

vsz


1 Answers

Checking the C standard, no such prefix exist for shorts.

like image 125
Some programmer dude Avatar answered Oct 31 '22 14:10

Some programmer dude