From 1b66868d5fd64bb6a677328764401fad96804ef3 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Thu, 5 Sep 2013 19:15:03 +0200 Subject: [PATCH] Use puts instead of printf. The classic "Hello World" example in C is actually often sort of wrong. While printf(3) does the job, it is inefficient to use, since the "format string" does not contain any format characters in this particular case. puts(3) is better suited, since it does not try to interpret format characters, and as an extra bonus, already appends the trailing newline for us. --- c/c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c/c.c b/c/c.c index 36465c8f..41113917 100644 --- a/c/c.c +++ b/c/c.c @@ -1,6 +1,6 @@ #include int main(void) { - printf("Hello World\n"); + puts("Hello World"); return 0; }