Mail Archives: djgpp/2000/07/07/07:41:56
On 7 Jul 2000 10:22:14 GMT, that hoopy frood Hans-Bernhard Broeker
scribbled the following:
>J-P <jstacey AT plato DOT wadham DOT ox DOT ac DOT uk> wrote:
>> Does anyone know why this program works "as-is" i.e. with no extra
>> pre-compiler #include lines:
>
>It works for no better reason than luck, combined with some laziness
>of the makers of the C programming language, back in 1979.
>
>C allows you to call functions defined elsewhere even if you give it
>no information at all about their argument and return types, as is
>usually found in the relevant #include. In such cases, it'll assume
>that the function's return value is int, and all numeric arguments, if
>any, are int or double.
I have a small query on this: what about longs and long doubles? I
thought that just default agrument promotions were performed
(char->int, short->int, float->double).
[snip]
--
Chris Mears
ICQ: 36697123
- Raw text -