by murderfs · 4y ago · 0 comments
#include <stdio.h>
#include <string.h>
#define HI "Hello, world\n"
int main() {
if (printf(HI) != strlen(HI)) {
return 1;
}
return 0;
}
(And I'm sure astute readers could even find fault with this implementation.)Obviously this is tongue-in-cheek; I would never write code that checks the output of printf(), even if perhaps, in some abstract way, I "should". If we were to believe that the purpose of a "hello world" program was to teach about error handling, then maybe we should write "hello world" this way. But I'm also not sure that's its purpose.