mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
14 lines
288 B
C
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;
|
|
}
|