There are plenty more: http://www.gnu.org/fun/humor.html
And my favourite: http://www.gnu.org/fun/jokes/helloworld.html
However there is an ugly error, in the code they use
void main()
:This is non-standard (process returns a random number upon completion). It should rather be
New professional
#include <stdio.h>
void main(void)
{
char *message[] = {"Hello ", "World"};
int i;
for(i = 0; i < 2; ++i)
printf("%s", message[i]);
printf("\n");
}
int main()
instead - with a correct, standard behavior (process returns 0, even if final return 0;
is omitted). Using void main()
implies the dreaded "undefined behavior"...