Re:Hello World, 1978
by amelius on Monday January 04, 2016 @08:01AM
(#10835359)
It seems that he forgot to include stdio.h.
[ Parent
| on HN ]
Re:Hello World, 1978
by tacostakohashi on Monday January 04, 2016 @08:13AM
(#10835408)
There were no function prototypes in K&R C, these were added in the ANSI C89 standard.
Even now, prototypes are optional in C (as opposed to C++), so this program is still valid, although it's likely to trigger some compiler warnings.
Even now, prototypes are optional in C
It's been illegal in standard C since 1999.
In 1978 you didn't have to include it; the compiler made assumptions about the function args and return type that held for printf.
C was... different then.
C was a lineal descendant of B, a language in which every variable had the same type: machine word. It was meant to be a step up (one step) from a macro assembler.
The existence of B always makes me laugh when someone claims Python is typeless. No, Python knows the difference between a string and a float, it just knows it at runtime. B, where everything is a machine word, and integers, floats, and pointers are all the same thing at the language level, is typeless.