Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions solutions/c/hello-world/1/hello_world.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "hello_world.h"

// Define the function itself.
const char *hello(void)
{
return "Hello, World!";
}
14 changes: 14 additions & 0 deletions solutions/c/hello-world/1/hello_world.h
Original file line number Diff line number Diff line change
@@ -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