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; }