31 lines
428 B
C
31 lines
428 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
char* hello() {
|
|
char* ptr = (char*)malloc(13);
|
|
if (ptr == NULL) {
|
|
return ptr;
|
|
}
|
|
ptr[0] = 'H';
|
|
ptr[1] = 'e';
|
|
ptr[2] = 'l';
|
|
ptr[3] = 'l';
|
|
ptr[4] = 'o';
|
|
ptr[5] = ' ';
|
|
ptr[6] = 'w';
|
|
ptr[7] = 'o';
|
|
ptr[8] = 'r';
|
|
ptr[9] = 'l';
|
|
ptr[10] = 'd';
|
|
ptr[11] = '!';
|
|
ptr[12] = '\0';
|
|
|
|
return ptr;
|
|
}
|
|
|
|
void goodbye(char* ptr) {
|
|
if (ptr != NULL) {
|
|
free(ptr);
|
|
}
|
|
}
|