mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
Add files via upload
This commit is contained in:
parent
5ca234369d
commit
730ebb9053
@ -1,7 +1,12 @@
|
|||||||
#include "hello_world.h"
|
#include "hello_world.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
const char *hello(void)
|
const char *hello(void)
|
||||||
{
|
{
|
||||||
|
char * ans = malloc(sizeof(char) * strlen("Hello, World!"));
|
||||||
|
strcpy(ans,"Hello, World!");
|
||||||
|
|
||||||
/* string is pointer of the first character */
|
/* string is pointer of the first character */
|
||||||
return "Hello, World!";
|
return ans;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user