5 ms·
It seems that he forgot to include stdio.h.
by amelius 11y ago
It seems that he forgot to include stdio.h.
- bitwize 11y agoIn 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.
- cbd1984 11y agoC 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.
- tacostakohashi 11y agoThere 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.
- cygx 11y agoEven now, prototypes are optional in C It's been illegal in standard C since 1999.
- deleted 11y ago[deleted]