From b129fd7de2f79659ac217cd456c7acd1b349ac16 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Thu, 25 Sep 2025 13:54:37 +0000 Subject: [PATCH] [Sync Iteration] c/hello-world/1 --- solutions/c/hello-world/1/hello_world.c | 7 +++++++ solutions/c/hello-world/1/hello_world.h | 14 ++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 solutions/c/hello-world/1/hello_world.c create mode 100644 solutions/c/hello-world/1/hello_world.h diff --git a/solutions/c/hello-world/1/hello_world.c b/solutions/c/hello-world/1/hello_world.c new file mode 100644 index 0000000..7be10b9 --- /dev/null +++ b/solutions/c/hello-world/1/hello_world.c @@ -0,0 +1,7 @@ +#include "hello_world.h" + +// Define the function itself. +const char *hello(void) +{ + return "Hello, World!"; +} diff --git a/solutions/c/hello-world/1/hello_world.h b/solutions/c/hello-world/1/hello_world.h new file mode 100644 index 0000000..70c0bb5 --- /dev/null +++ b/solutions/c/hello-world/1/hello_world.h @@ -0,0 +1,14 @@ +// This is called an include guard, which ensures that the header is only +// included once. You could alternatively use '#pragma once'. See +// https://en.wikipedia.org/wiki/Include_guard. +#ifndef HELLO_WORLD_H +#define HELLO_WORLD_H + +// Declare the 'hello()' function, which takes no arguments and returns a +// 'const char *', i.e. a pointer to a character (in this case the first +// character in a string). The function itself is defined in the hello_world.c +// source file. This function is called by the test case(s) in the test source +// file test_hello_world.c. +const char *hello(void); + +#endif