From 730ebb9053b935627075040d751e71719724176d Mon Sep 17 00:00:00 2001 From: Christian Bender Date: Fri, 26 Jan 2018 19:38:12 +0100 Subject: [PATCH] Add files via upload --- exercism/hello-world/hello_world.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exercism/hello-world/hello_world.c b/exercism/hello-world/hello_world.c index bd922123..fef077b3 100644 --- a/exercism/hello-world/hello_world.c +++ b/exercism/hello-world/hello_world.c @@ -1,7 +1,12 @@ #include "hello_world.h" +#include +#include const char *hello(void) { + char * ans = malloc(sizeof(char) * strlen("Hello, World!")); + strcpy(ans,"Hello, World!"); + /* string is pointer of the first character */ - return "Hello, World!"; + return ans; }