14 lines
288 B
C
Raw Normal View History

2018-01-24 22:24:43 +01:00
#include "hello_world.h"
2018-01-26 19:38:12 +01:00
#include <stdlib.h>
#include <string.h>
2018-01-24 22:24:43 +01:00
const char *hello(void)
{
2018-01-26 19:38:12 +01:00
char * ans = malloc(sizeof(char) * strlen("Hello, World!"));
2018-07-24 13:38:45 -05:00
if (!ans) return NULL;
2018-01-26 19:38:12 +01:00
strcpy(ans,"Hello, World!");
2018-01-24 22:24:43 +01:00
/* string is pointer of the first character */
2018-01-26 19:38:12 +01:00
return ans;
2018-01-24 22:24:43 +01:00
}