Earlier quoted context omitted.
hello.c is meant as the first program a new student encounters when learning C. At that point, the student has enough to worry about; writing code to a file, checking for syntactic errors, basic program structure, using the compiler, executing the binary, understanding what `#include ` means,... Sure, we could update it: // hello_v2.0.c #include #include #include int main(void) { printf("Hello, World!\n"); fflush(std…
This just demonstrates that C is an awful programming language for writing correct programs. Compare this with Rust, where the usual hello world will just do the right thing: $ cat > a.rs fn main() { println!("Hello World"); } $ rustc a.rs $ ./a Hello World $ echo $? 0 $ ./a > /dev/full thread 'main' panicked at 'failed printing to stdout: No space left on device (os error 28)', library/std/src/io/stdio.rs:1187:9 not…
Re: Bugs in Hello World
#261Or Zig which tries to make it easy to actually handle those errors.