3 ms·
It's really easy to make a C hello world program that forwards the success of printf: #include <stdio.h> int main(void) { return printf("he
by dlcarrier 3mo ago
It's really easy to make a C hello world program that forwards the success of printf:
#include <stdio.h>
int main(void)
{
return printf("hello, world\n");
}
I just tested it in a Bash shell, and it works great, only adding a single word, with clear functionality, to the example.
- boomlinde 3mo agoThis program will always give a non-zero return code. This is unconventional if not straight up wrong, if the goal is for main to indicate whether it was successful in printing.