Re: Printf question.
- From: usenet@xxxxxxx
- Date: 30 Dec 2005 20:05:28 GMT
praeiji <spacecaps@xxxxxxxxx> wrote:
> But why are they typecasted to int? Does it come from gcc when it sees
> "%d" and the printf function?
No, they are not typecasted, but `promoted', which is not the same thing.
Promotion is what happens when you call a function that has no prototype, or
when a function with a variable number (variadic) of arguments like printf()
is called. With promotion, all arguments are converted to a generic 'bigger'
type: char and short to int, float to double.
Ico
--
:wq
^X^Cy^K^X^C^C^C^C
.
- Follow-Ups:
- Re: Printf question.
- From: Charles Richmond
- Re: Printf question.
- References:
- Printf question.
- From: praeiji
- Re: Printf question.
- From: usenet
- Re: Printf question.
- From: praeiji
- Printf question.
- Prev by Date: Re: Printf question.
- Next by Date: Re: void * pointer convert problem.
- Previous by thread: Re: Printf question.
- Next by thread: Re: Printf question.
- Index(es):
Relevant Pages
|