Source

perlxs / libtest.c

Full commit
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char** test_func(int a, int* b) {
    char **string_list;

    string_list = malloc(sizeof(char*) * 3);
    if (string_list == NULL) {
        return NULL;
    }

    printf("a %d\n", a);
    if (b != NULL) {
        printf("b %d\n", *b);
    }
    else {
        printf("b NULL\n");
    }

    string_list[0] = strdup("hello world0");
    string_list[1] = strdup("hello world1");
    string_list[2] = NULL;

    return string_list;
}