TheAlgorithms-C/exercism/hello-world/hello_world.c
2018-07-24 13:38:45 -05:00

14 lines
288 B
C

#include "hello_world.h"
#include <stdlib.h>
#include <string.h>
const char *hello(void)
{
char * ans = malloc(sizeof(char) * strlen("Hello, World!"));
if (!ans) return NULL;
strcpy(ans,"Hello, World!");
/* string is pointer of the first character */
return ans;
}