TheAlgorithms-C/exercism/hello-world/hello_world.c
2018-01-26 19:38:12 +01:00

13 lines
261 B
C

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