Print a short instead of an int... ? What's up with "%hd"?
- From: Martin Wells <warint@xxxxxxxxxx>
- Date: Mon, 22 Oct 2007 03:41:21 -0700
When passing arguments to a VAL function, all integer types are
promoted, and floats become doubles. Therefore, signed short will be
promoted to signed int. Therefore I can't see any reason why you'd
have:
printf( "%hd", my_short);
instead of:
printf( "%d", my_short);
Martin
.
- Follow-Ups:
- Re: Print a short instead of an int... ? What's up with "%hd"?
- From: James Kuyper Jr.
- Re: Print a short instead of an int... ? What's up with "%hd"?
- Prev by Date: Re: sizeof(ptr) = ?
- Next by Date: Re: Function call before main.
- Previous by thread: need some basic progarams in c
- Next by thread: Re: Print a short instead of an int... ? What's up with "%hd"?
- Index(es):
Relevant Pages
|