Ad

Return Hello World

Code
Diff
  • #include <string.h>
    #include <stdlib.h>
    #define x "Hello World."
    
    char *Hi(void) {
        char *ans = calloc(strlen(x) + 1, sizeof(char));
        strcpy(ans, x);
        return ans;
    }
    • #include <string.h>
    • #include <stdlib.h>
    • #define x "Hello World."
    • char *Hi(void) {
    • char *ans = calloc(13, sizeof(char));
    • strcpy(ans, "Hello World.");
    • char *ans = calloc(strlen(x) + 1, sizeof(char));
    • strcpy(ans, x);
    • return ans;
    • }